Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Is it possible to configure Channel names when using Redis? #2671

@josemaia

Description

@josemaia

Hello,

In an application that is using SignalR and has Redis configured, is there a way we can customize the channel names used?

My situation is as follows:

  • ASP.NET Core app, hosted on Azure VMs, whose API uses SignalR to communicate with on-prem servers.
  • Our users may have separate installations (separate azure subscriptions, etc.) per customer.
  • However, they want to use a single server running Redis for all of these customers.

From what I can tell of the way SignalR uses redis pub/sub, this would lead to potential conflicts - while for two VMs of the same customer, we do want the SignalR channels to be shared, we don't want to receive messages from one customer in the other.

An example would be: imagine I am logged in on Customer A and Customer B's installations, with the same email, and a web page open on both. One of my hubs has a pubsub channel with the format "WebApi.Services.SignalR.NotificationHub:user:jose.maia@example.com". Upon doing an async API request for Customer A, whether it hits server A1 or A2, I should get my notification on web page A. However, if the channel has the same format on customer B's hubs, I will also get the notification on web page B, correct?

From looking at the code, I believe that RedisChannels's usage of a prefix would allow for this, if instead of the RedisHubLifetimeManager instancing RedisChannels just with the Hub's FullName, there was an option to allow a custom prefix (or... pre-prefix, I guess? :) ).

Is there a way to avoid this or, by design, each customer would require a separate Redis server?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions