Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Service Bus Topics Multiple subscribers

I am new to Azure Service Bus and would like to know if I can multiple subscribers to a queue or topic? In rabbit MQ I can have multiple subscribers to 1 publisher.

What I am trying to do is, I am using CQRS and when certain commands come into the system when the event is handled I want to push them into a message queue.

I want 2 subscribers to be able to get the messages from that queue, one for me to process internally. another one for process and send externally.

like image 996
ChampChris Avatar asked Aug 25 '17 00:08

ChampChris


People also ask

Can a topic have multiple subscription?

Subscription overview The subscriber client receives and processes the messages published to the topic. A topic can have multiple subscriptions, but a given subscription belongs to a single topic.

What is topic and subscription in Azure Service Bus?

A topic subscription resembles a virtual queue that receives copies of the messages that are sent to the topic. Consumers receive messages from a subscription identically to the way they receive messages from a queue.


1 Answers

I am new to Azure Service Bus and would like to know if I can multiple subscribers to a queue or topic?

Yes. This is possible with Azure Service Bus Topics. There can be multiple subscribers to a message sent to a topic. From this link:

In contrast to queues, in which each message is processed by a single consumer, topics and subscriptions provide a one-to-many form of communication, in a publish/subscribe pattern. Useful for scaling to very large numbers of recipients, each published message is made available to each subscription registered with the topic. Messages are sent to a topic and delivered to one or more associated subscriptions, depending on filter rules that can be set on a per-subscription basis.

The way it works is that you create a topic and then create multiple subscriptions in that topic. In each subscription, you can define message filtering rules. When a message is sent to a topic, Azure Service Bus matches that message against the filtering rules in each subscription and if a matching rule is found, then the message is sent to that subscription.

like image 76
Gaurav Mantri Avatar answered Sep 20 '22 18:09

Gaurav Mantri