Azure Service Bus Topics Multiple subscribers

南楼画角 提交于 2020-01-02 04:37:06

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/45872802/azure-service-bus-topics-multiple-subscribers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!