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?

Rasmi
  • 501
  • 1
  • 6
  • 26
  • Please edit your question and include some code. Show us what you have tried so far and the issues you're running into. – Gaurav Mantri Apr 11 '18 at 06: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 – Rasmi Apr 11 '18 at 06:48
  • 1
    @JayGong found the Java SDK for Service Bus. Please see his answer below. – Gaurav Mantri Apr 11 '18 at 07:09
  • @Rasmi You could mark my answer if you think my answer helps you.That could for others' references, thanks a lot Rasmi. – Jay Gong Nov 09 '18 at 01:58

2 Answers2

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

spottedmahn
  • 14,823
  • 13
  • 108
  • 178
Jay Gong
  • 23,163
  • 2
  • 27
  • 32
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.

Dave
  • 31
  • 4