How to programmatically manage Service bus notification hubs?

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

If you want to manage Hubs programmatically then you need Windows azure Service Bus client 2.1.2.0 (or higher) which can be downloaded here.
This API contains a new *Description entity called NotificationHubDescription. Remember we have TopicDescription, QueueDescription and SubscriptionDescription. The NotificationHubDescription is the new class which fully describes service bus notification hub as entity.

Here is an example which shows how to set programmatically SID and SECRET of the hub.

            NamespaceManager nm = NamespaceManager.CreateFromConnectionString("…");

            NotificationHubDescription hubDesc = nm.GetNotificationHub("yourhubname");

            var sid = hubDesc.WnsCredential.PackageSid;

            var secret = hubDesc.WnsCredential.SecretKey;


Posted Aug 16 2013, 12:14 AM by Damir Dobric
developers.de is a .Net Community Blog powered by daenet GmbH.