Closed ryanbuening closed 4 years ago
The comments on this StackOverflow answer describe the situation.
You need to have some centralized storage to count all the connections when behind a load balancer. Rebus.SignalR doesn’t provide this storage itself, so an SQL table is the correct way to go.
Is there a way to utilize Rebus.SignalR to determine the number of users/connections for a specific group when behind a load balancer?
I initially tried setting up a
ConcurrentDictionary
of connections with the key being theConnectionId
and including theGroupName
for each connection (adding/removing as necessary). However, this solution doesn't work when behind a load balancer as theConcurrentDictionary
isn't shared across servers.I could setup some persistence via a SQL table. But before I did that I thought I'd see if I might be overlooking something that Rebus.SignalR provided that would help.