Question

We use Azure Service Bus Topic/Subscriptions, and for some reason we have to create Subscriptions on Worker Role side, so in Web Role we cannot know what subscriptions we created, the Subscription name is dynamic generated by other means.

So in Web Role, can I just get all subscriptions (mainly its name) via known Topic name?

Was it helpful?

Solution

When you dynamically create your subscriptions, make sure they always include the name of the Worker Role (or other information that allows you to identify the subscription).

Then you can use the GetSubscriptions method on the NamespaceManager class, which allows you to get a list of all subscriptions for a given topic. There's also an overload for the GetSubscriptions method which allows you to filter the list of subscriptions.

More information: http://msdn.microsoft.com/en-us/library/hh293131.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top