Azure Service Bus - Can subscribers sign up for their own subscription and share the same message?

I am new to Azure Service Bus and have created successful documents to create a theme and a separate subscriber application to receive its message.

Based on this article, I quote: β€œA topic can contain up to 2000 subscribers, each of which receives independent copies of all messages sent on this topic. One or more subscribers can independently subscribe to a subscription and compete for messages from it.”

http://convective.wordpress.com/2011/06/08/windows-azure-appfabric-service-bus-queues-and-topics/

I am interested in doing this in order to deploy it for several applications, to independently subscribe to the same topic, but not compete for them.

My current poc has one sender and two separate applications subscribed to the same topic and subscription. The behavior I see is that if I send one message from the sender, he will receive one of two signed applications; but not another.

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

+8
service azure bus
source share
2 answers

When creating a topic subscription, she has a specific subscription name. Any consumer who then begins to request messages for this subscription name will compete for messages on this subscription. If you want independent applications to receive each instance of a message sent on a topic, each of them will have to create its own subscription on this topic. You can almost view each subscription as a queue for yourself, which is submitted by topic.

The example I will give relates to college. The topic is β€œNew Student,” and every department in the college wants a copy of the message for the new student. Thus, each department will have its own subscription. There would be signatures "Music", "Billings", "Science", "Mathematics", etc. Each of them subscribed to the topic "New Student". Thus, each department receives a copy of the new student message or can filter on the things they need if they want. If the department is lagging behind in processing, they can deploy more processor instances using their subscription name, thereby increasing their throughput in theory, as more consumers compete for messages in their subscription.

So, in your example, each application will need to either create its own subscription, or assign a unique subscription to start pulling from the moment it starts. Please note that if you allow the lifetime of the application to choose the validity period of the subscription (which means that you create a subscription when you start the application and destroy it when you close the application), you need to know that if there are no active subscribers, messages sent to the topic will be simple lost. However, you can create a trick for the entire subscription that only receives messages that are not delivered to any other subscription. It really depends on what you are trying to accomplish.

+18
source share

What you are looking for is not a Service Bus, but an Event Hub. The Event Hub works exactly as you describe, and it can also be accessed using AMQP.

0
source share

All Articles