Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up Monitoring for queue in activemq

I read in ActiveMQ page, using JMX we can monitor queues in activemq. How can we get notified if a queue has messages (depth high) or service interval is high in ActiveMQ. Without using any shell scripts in unix environment. Is it possible through Java program? If yes, give me some ideas to get this done.

like image 413
Vignesh Avatar asked Nov 11 '11 19:11

Vignesh


1 Answers

For a JMX-free approach, you can also use the XML feed served by the activemq console page. The XML feed is hosted at http://ip:port/admin/xml/queues.jsp

This will have tags similar to this for each queue:

<queue name="your queue">
<stats size="0" consumerCount="1" enqueueCount="0" dequeueCount="0"/>
....
</queue>

Just parse this XML in your code and you are good to go.

like image 156
Faheem Sohail Avatar answered Sep 22 '22 20:09

Faheem Sohail