Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMS Message Counter

Tags:

java

jms

I would like to display JMS queue statistics on the page where I may present how many messages are in the queues

Is there any way to do that in universal way (without using any provider specific API) whithout iterating through all messages?

I know that I may achive that using QueueBrowser.getEnumeration() however it is too costly to iterate over all messages just for simple counting functionality.

like image 974
Marcin Michalski Avatar asked Aug 04 '26 17:08

Marcin Michalski


2 Answers

I see no reference to statistics in the JMS 1.1 spec.

My experience w/ statistics is that they're available through vendor-specific interfaces.

like image 80
John M Avatar answered Aug 07 '26 06:08

John M


I do not believe that it is possible in the manner you seek.

Although your question specifically asks about non-provider specific methods I will offer this:

ActiveMQ can be monitored via JMX which allows you to interrogate many things including queue size. You can always create an interface which you can then extend on a per-provider basis (and as an example you would retrieve queue size from an ActiveMQ provider implementation via JMX).

like image 23
S73417H Avatar answered Aug 07 '26 05:08

S73417H



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!