-
Notifications
You must be signed in to change notification settings - Fork 0
Azure service bus
This article explains how to use the Windows Azure Service Bus backplane for SignalR. Introduced by Clemens Vasters on his blog and distributed via this NuGet package, this backplane uses the Windows Azure Service Bus as a messaging layer.
Install the SignalR libraries using NuGet:
Install-Package SignalR
Install the SignalR.WindowsAzureServiceBus package using NuGet:
Install-Package SignalR.WindowsAzureServiceBus
UseWindowsAzureServiceBus
(
serviceBusNamespace, /* the service bus namespace prefix */
serviceBusAccount, /* "owner" or some other account */
serviceBusAccountKey, /* the key, which can be copied from the Windows Azure portal */
topicPathPrefix, /* the prefix applied to the name of each topic used */
numberOfTopics /* how many topics across which messages will be sharded */
);namespace WindowsAzureServiceBusBackedSignalR { public class Global : System.Web.HttpApplication { private string serviceBusNamespace = "myazurenamespace"; private string serviceBusAccount = "owner"; private string serviceBusAccountKey = "fhsakjfdl22324323wehfjasdflkj2q22323ewykhwej2n33324na4sd=="; private string topicPathPrefix = "mywebapp"; private int numberOfTopics = 1;
protected void Application_Start(object sender, EventArgs e)
{
SignalR.GlobalHost.DependencyResolver.UseWindowsAzureServiceBus(
serviceBusNamespace, /* the service bus namespace prefix */
serviceBusAccount, /* "owner" or some other account */
serviceBusAccountKey, /* the key, which can be copied from the Windows Azure portal */
topicPathPrefix, /* the prefix applied to the name of each topic used */
numberOfTopics /* how many topics across which messages will be sharded */
);
}
} }