Sending a signalr message directly using scaling from another Azure role

I have 2 roles in an Azure application for cloud services: a web role (signalr connections here) and a working role.

The web role uses the Azure Service Bus as the scale provider.

At certain points in time, the working role will emit certain events. I would like to send this data directly to clients connected to the hub.

My current implementation includes the role of the job of placing a message in the service bus queue that the web role signs, then the web role passes this message to clients through a HubContext call.

My question is: how can I send this message directly to related clients from a working role? So far I have covered 3 methods:

  • Configure signalr as a web role so that they use the same busbus partition. - This does not work as intended, since instances of the work role โ€œsteal messagesโ€ from subscribing to topics intended for the web role. This would seem to be the cleanest way to do this, but configuration is a problem.

  • Use the .Net client to send a hub message - this is not ideal, since it loads unnecessary load on the web role, and also doubles the number of service bus messages compared to the above method.

  • Manually writing a signalr compatible message in a topic is very hacked and could be broken.

I know that the team is currently rewriting the scale for the next version, but is this possible at some point?

Edit: I noticed that this is supported in the implementation of RabbitMq .

+4
source share
1 answer

It seems that the problem with my configuration was due to the fact that the first method does not work. However, it seems that this method is slower to the end (about 150 ms) even with one smaller message in the loop.

I will wait and see if this zoom operation improves before any changes are made.

+1
source

All Articles