Azure服务总线主题多个订阅者 [英] Azure Service Bus Topics Multiple subscribers

查看:111
本文介绍了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的新手,想知道我是否可以 队列或主题的订阅者?

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

是的. 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:

与队列相反,在队列中,每个消息都由单个消息处理 消费者,主题和订阅提供了一对多形式的 通信,以发布/订阅模式进行.有助于缩放到 大量的收件人,每条发布的邮件都是 可用于向该主题注册的每个订阅.消息是 发送给一个主题并传递给一个或多个相关的订阅, 取决于可以基于每个订阅设置的过滤器规则.

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.

它的工作方式是创建一个主题,然后在该主题中创建多个订阅.在每个订阅中,您可以定义消息过滤规则.将消息发送到主题时,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服务总线主题多个订阅者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆