Azure的服务总线 - 用户可以单独订阅订阅,共享同样的信息? [英] Azure Service Bus - subscribers can independently subscribe to a subscription and share the same message?

查看:303
本文介绍了Azure的服务总线 - 用户可以单独订阅订阅,共享同样的信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Azure Service Bus和创造成功的POCS创建一个主题,一个单独的用户应用程序来接收它的消息。

I'm new to Azure Service Bus and have created successful pocs for creating a topic and a separate subscriber application to receive its message.

,我引述如下:
的话题可以有与之相关的高达2000订阅,每一个被发送到主题的所有消息的独立副本。一个或多个用户可以单独订阅订阅和竞争作为从它的消息。

Based on this article, I quote: "A topic can have up to 2,000 subscriptions associated with it, each of which gets independent copies of all messages sent to the topic. One or more subscribers can independently subscribe to a subscription and compete for messages from it."

<一个href=\"http://convective.word$p$pss.com/2011/06/08/windows-azure-appfabric-service-bus-queues-and-topics/\">http://convective.word$p$pss.com/2011/06/08/windows-azure-appfabric-service-bus-queues-and-topics/

我有兴趣做的是​​扩大这种多个应用程序独立订阅同一主题,但没有竞争力他们。

What I'm interested to do is to expand this for multiple applications to independently subscribe to the same topic, but not compete for them.

我目前的POC有一个发送者和订阅同一主题和订阅两个独立的应用程序。说我看到的行为是,如果我从后发送一个消息,无论是两班倒订阅应用程序将获得它的一个;而不是其他。

My current poc has one sender and two separate applications subscribed to the same topic and subscription. The behavior that I'm seeing is that if I post one message from the sender, either one of the two running subscribing applications will receive it; but not the other.

我的问题是,如果多个独立的应用程序可以收到同样的主题消息?任何意见将大大AP preciated!

My question is if multiple, independent applications can receive the same topic message? Any advice would be greatly appreciated!

推荐答案

在创建预订到主题它有一个特定的订阅名称。任何消费者认为然后开始请求消息的订阅名称将争夺上订阅的邮件。如果你想独立的应用程序的每个接收发送到一个话题,他们将每个人都有创造自己订阅的主题邮件的副本。作为本身就是一个队列被话题喂,你几乎可以查看每个订阅。

When you create a subscription to a topic it has a specific subscription name. Any consumer that then starts requesting messages for that subscription name will compete for messages on that subscription. If you want independent applications to each receive a copy of the message sent to a topic they will each have to create their own subscription to the topic. You can almost view each subscription as a queue unto itself being fed by the topic.

我给的例子是一所大学的。主题是新学生与高校内部各部门要接收消息的副本,新的学生。因此,每个部门将有它自己的订阅。这里将是音乐,比林斯,科学,数学的订阅,等他们每个人都订阅了新生的话题。这样,每个部门收到新的学生邮件的副本,甚至可以在他们所关心的,如果他们想要的东西进行过滤。如果部门处理这些落在后面,他们可以使用他们的订阅名旋转起来处理器的多个实例,从而提高他们的吞吐量在理论上,因为越来越多的消费者,然后在他们的订阅消息竞争。

The example I'll give is of a college. The topic is "New Student" and each department within the college wants to receive a copy of a message for a new student. Thus each department would have it's own subscription. There would be "Music", "Billings", "Science", "Math" subscriptions, etc. Each of them subscribing to the New Student topic. In this way each department receives a copy of the new student message, or can even filter on things they care about if they want. If the department gets behind in processing these they can spin up more instances of the processor using the their subscription name, thus increasing their throughput in theory since more consumers are then competing for the messages in their subscription.

所以,在你的榜样,每个应用程序将需要或者创建自己的订阅或分配一个唯一的订阅,开始从启动时拉动。请注意,如果你让应用程序生命周期决定订阅的生命周期(即创建预订时,应用程序启动并摧毁它,当应用程序关闭),你需要知道,如果没有活动订阅然后消息发送到主题将简单地丢失。但是,您可以创建一个catch只接收不传递到任何其他的订阅邮件所有订阅。这真的取决于你所要完成的任务。

So, in your example, each application would need to either create it's own subscription or be assigned an unique subscription to start pulling from when it starts up. Note that if you let the application lifetime decide the lifetime of a subscription (meaning you create a subscription when the app starts and destroy it when the app closes) you need to be aware that if there are no active subscriptions then messages sent to the topic will simply be lost. You can however create a catch all subscription that only receives messages that are not delivered to any other subscription. It really depends on what you are trying to accomplish.

这篇关于Azure的服务总线 - 用户可以单独订阅订阅,共享同样的信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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