My application creates some subscriptions (~30) on Service Bus for the same number of topics. It is a client application and I'm creating unique names for subscriptions to ensure that each application instance received all messages. Being a client app, startup time is very important, and I've noticed that it's taking much time to create the subscriptions, thinking that maybe I'm not using the best option.
I'm creating subscription clients from a namespace manager because I also need filters on this subscriptions:
namespaceManager.CreateSubscriptionAsync("topic","uniqueSubscriptionName",newSqlFilter("my rule"));
ServiceBus guidelines suggest using a shared MessagingFactory to create objects, but I see two problems for MessagingFactory.CreateSubscriptionClient:
- I can't specify a filter when creating subscriptions
- it is not async
Which is the most efficient way to create those subscriptions including their filters? Remark: I'm using Windows Azure SDK 2.1.4 because the application must be compatible with both Azure ServiceBus and Windows Server ServiceBus
Additionally: is it a bad practice to create many topics/subscriptions? Should I create a shared subscription and internally forward messages to specific components?