2
votes

I am learning how to communicate between Azure cloud apps and client apps, and worked through this tutorial.

I currently have a single instance of a .exe worker process which sends messages via the service bus. I also have a client role which I run on my local machine to read the messages. However, when I run multiple instances of the client, each client picks up some of the messages and none of them is getting a full readout. Is it possible to use a queue or the service bus so that every instance of the client can see all of the messages generated by the worker?

For example, 3 people on 3 different computers might want to independently monitor the status of the same compute task.

2

2 Answers

9
votes

In that case you shouldn't be working with Service Bus Queues but with Service Bus Topics/Subscriptions.

In contrast to Service Bus queues, where each message is processed by a single consumer, topics and subscriptions provide a one-to-many form of communication, using a publish/subscribe pattern. It is possible to register multiple subscriptions to a topic. When a message is sent to a topic, it is then made available to each subscription to handle/process independently.

For your example you would need 1 Service Bus Topic with a Subscription on that Topic for each client application.

More information: How to Use Service Bus Topics/Subscriptions

-1
votes

Because I believe you are using "Peek" as a message receive mode which will share (not equally) total messages between the instances you run.

Hope that helps.