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?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top