Ben Foster
Ben Foster

Reputation: 34830

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?

Upvotes: 7

Views: 2069

Answers (1)

Sreeram Garlapati
Sreeram Garlapati

Reputation: 4993

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

Upvotes: 4

Related Questions