Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Message type based routing with Azure Service Bus

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?

like image 874
Ben Foster Avatar asked Dec 24 '13 12:12

Ben Foster


People also ask

Which protocol is used by Azure Service Bus for message delivery?

The official Azure SDKs generally use the AMQP protocol for sending and receiving messages from Service Bus.

Does Azure Service Bus store messages?

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.

What is Azure messaging in Service Bus?

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.


1 Answers

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

like image 78
Sreeram Garlapati Avatar answered Nov 15 '22 09:11

Sreeram Garlapati