简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM