Search code examples
signalrservicebusazureservicebus

SignalR Service Bus Topic Name Collision


I'm using the SignalR Service Bus package to let SignalR coordinate activity across several azure web role instances within a deployment.

I used to be able to choose the service bus topic name to use. After updating SignalR and the Service Bus package to rc1, that option is no longer available. Instead, SignalR uses the name of the web role as its topic name.

The problem is that when multiple azure deployments are running simultaneously (i.e. Production and Staging), they fight over the single service bus topic that's automatically named after the web role. I wind up getting large numbers of duplicate messages. I want each deployment to have its own service bus topic.

How can I use a single service bus namespace to manage SignalR connections across multiple deployments of the same project? Or even two deployments of two different projects that happen to have web roles of the same name?


Solution

  • I solved my problem. Instead of using

    GlobalHost.DependencyResolver.UseWindowsAzureServiceBus()
    

    I'm now using

    GlobalHost.DependencyResolver.UseServiceBus()
    

    which I can pass a topic prefix.

    UseWindowsAzureServiceBus still causes problems when I have Production and Staging deployments running simultaneously, but I'm marking this question as solved.