I'm working on a system that needs to auto scale worker processes which pull messages from a service bus topic for processing.
To do this I need to know the number of unprocessed messages for a given subscription. How do I do that?
I had a look at the SubscriptionClient Class, but there doesn't appear to be a way to find the number of messages waiting to be processed.
You can use the NamespaceManager
to get your QueueDescription
or TopicDescription
by using GetMessage(_name_)
or GetTopic(_name_)
. These descriptions expose the value as MessageCount
.
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With