Message type based routing with Azure Service Bus
Asked Answered
M

1

7

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?

Matteson answered 24/12, 2013 at 12:34 Comment(3)
I don't think that this is an easy question to answer. it is too open and too opinion based. there will be many relevant considerations around the capabilities of the clients, the volumes of messages, resiliency required, etc.Altis
Fair enough, I've updated my question to ask for the "simplest" approach.Matteson
I have to agree with Yossi. It depends mostly on the architectural approach you want to take. But using a topic with subscriptions per message type makes a lot of sense. This way, it's easy for the publisher (client, mostly?) to push all of its messages to the same endpoints, where you can easily extend and add extra message types and filtersInstitutor
F
4

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

Fantinlatour answered 23/9, 2014 at 21:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.