3

How could i get the total number of unprocessed message count from Azure Service bus using JAVA. Is there any API that can show the total number of message that is yet to be processed.

Is there any equivalent to the below .Net library in JAVA link

.Net Namespace: Microsoft.ServiceBus.Messaging

Whats the equlant for the above .Net Namespace in JAVA?

4
  • Please edit your question and include some code. Show us what you have tried so far and the issues you're running into. Commented Apr 11, 2018 at 6:32
  • With respect to code, there are no API's that i could find in the internet. The question is all about is there any API that can give me the number of message in the service bus using JAVA! @GauravMantri Commented Apr 11, 2018 at 6:48
  • 1
    @JayGong found the Java SDK for Service Bus. Please see his answer below. Commented Apr 11, 2018 at 7:09
  • @Rasmi You could mark my answer if you think my answer helps you.That could for others' references, thanks a lot Rasmi. Commented Nov 9, 2018 at 1:58

2 Answers 2

1

Is there any API that can give me the number of message in the service bus using JAVA?

You could refer to Message counters doc. You could use MessageCountDetails Class to get ActiveMessageCount property.

Which is equivalent to the .NET library MessageCount in java: https://learn.microsoft.com/en-us/java/api/com.microsoft.azure.management.servicebus._queue.messagecount

Sign up to request clarification or add additional context in comments.

3 Comments

the class Microsoft.ServiceBus.Messaging is not available in JAVA
@Rasmi Don't know what you want. The ActiveMessageCount shows the number of the pending messages, does it?
@Rasmi You're welcome.Please mark it for others' reference on the forum.Thx a lot.
0

There are Java classes available for management of the Service Bus and I think the one you're looking for is MessageCountDetails. There are examples of how to use the management classes in their GitHub repo. Currently that uses version 0.9.7 of the Azure Service Bus libraries, but same classes seem to exist in the latest 2.0.0-PREVIEW-7.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.