What is the simplest approach to achieve strongly typed message based routing with Azure Service Bus.
Assuming we only have one consumer and are using Service Bus Queues, is it easier to create a queue per message type (in our case, Event messages), or simply create a single queue for all messages and handle the routing on the consumer?
If we have more than one consumer and want to do pub-sub messaging, should we create a topic per message type and a subscription per consumer per message type, or just one topic for all messages and then handle the routing on the consumer?
The official Azure SDKs generally use the AMQP protocol for sending and receiving messages from Service Bus.
What Is Azure Service Bus Queue? Messages are sent to and received from queues. Queues enable you to store messages until the receiving application is available to receive and process them.
Azure Service Bus allows you to build applications that take advantage of asynchronous messaging patterns using a highly-reliable service to broker messages between producers and consumers.
For the Pub-sub messaging case: the right way is to create a Topic per messageType (use BrokeredMessage.ContentType property for this) and then create a Subscription per messageType.
How many Topics, or Queues to Create should really be driven by the Scale you are looking at.
Sree
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With