I must be missing something when setting up SignalR to use an Azure Service Bus. I have my App Service (API - Web API 2) setup to run 3 constant instances (currently), upon startup, the API uses the Service Bus connection string and sets the appropriate topic prefix.
On the front-end, SignalR is able to connect to my API, but messages are only sometimes received by the client. My assumption is that the client only receives messages from the server to which it originally connected. This leads me to believe that SignalR is not using the Service Bus correctly. When viewing the Service Bus via Azure, I do see that topics are being created, but there are no messages in any of them (I also see subscriptions).
So, as far as I can tell, SignalR between the client and server is still using a direct connection instead of going through the Service Bus. Note that the client is using the URL of the API for the SignalR connection -- is this correct?
SignalRConfig (During app startup.)
var serviceBusConnectionString = configHelper.SignalR.ServiceBusConnectionString;
var serviceBusTopicPrefix = configHelper.SignalR.TopicPrefix;
Logger.Info("SignalR: configuring");
// Use the service bus, if specified.
if (serviceBusConnectionString != null && serviceBusTopicPrefix != null) {
Logger.Info("SignalR: using service bus");
GlobalHost.DependencyResolver.UseServiceBus(serviceBusConnectionString, serviceBusTopicPrefix);
}
app.MapSignalR();
The above code runs for each instance, I have no idea if this is correct or not. Perhaps that is why I am seeing multiple topics, e.g. signalr_topic_my-app-staging_0
-- 0 through 5.
Note that I've tried to follow this (outdated) tutorial: https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-with-windows-azure-service-bus
Microsoft.*.SignalR*
, can give specifics if needed, one I'm back in front of my pc. – Josh M.