Azure服务总线主题多个订阅者

Azure服务总线主题多个订阅者

本文介绍了Azure服务总线主题多个订阅者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Azure Service Bus的新手,想知道我是否可以让多个订阅者加入一个队列或主题?在Rabbit MQ中,我可以有1个发布者的多个订阅者.

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.

我想做的是,我正在使用CQRS,当处理事件时某些命令进入系统时,我想将它们推入消息队列.

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.

我希望2个订阅者能够从该队列中获取消息,一个供我内部处理.另一个用于处理并从外部发送.

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.

推荐答案

是的. Azure Service Bus主题可以做到这一点.发送到某个主题的消息可以有多个订阅者.从此 link :

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

它的工作方式是创建一个主题,然后在该主题中创建多个订阅.在每个订阅中,您可以定义消息过滤规则.将消息发送到主题时,Azure Service Bus将该消息与每个订阅中的筛选规则进行匹配,如果找到匹配规则,则将该消息发送到该订阅.

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.

这篇关于Azure服务总线主题多个订阅者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 06:44