Vasiliy Ivanov
Vasiliy Ivanov

Reputation: 152

How to debug azure service bus messaging?

I work in team with several developers. They have running service with listener on queue 'test'. I have the listener too. But I can't get the brokeredMessage on my listener. Can I turn off other listeners to get brokeredMessage for my service? Can I use policy for it? I've created debug policy and use the connecting string from here. Also I checked out listen option for development but I see some listener catch the brokeredMessage again. How to resolve it? Thank you

Upvotes: 1

Views: 1080

Answers (1)

Brett Rigby
Brett Rigby

Reputation: 6226

If I understand your question correctly, you have a queue 'test' set-up in Azure Service Bus, and you have multiple listeners re-acting to a message when it's posted, is that right?

If you're using an Azure Service Bus queue, then when a message is posted to it, it will stay there until a listener removes it from the queue for processing. When that happens, the message is no longer available for another listener to receive it, as the intention is that the message is only processed once.

If you want to have multiple listeners watch for and re-act to a message appearing on the queue, maybe to process different things for the message, like one listener to check stock and another listener to process payment for example, then you might want to look at using the Topics/Subscriptions facility within the Service Bus - this allows you to create different subscriptions using rules, that can help you manage the multiple processing of a message by multiple listeners.

Hope this helps.

Upvotes: 1

Related Questions