I need a way for getting queue size in ActiveMQ without using JMX or Iterate all queue using JMS. Is there any solution for getting queue size using ActiveMQ API.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Add Statics Broker Plugin to your activemq.xml . Following is the code Snippet to fetch ActiveMQ Stats.
This will get the size of all the queues from ActiveMq.For getting statics of specific topic.
It will fetch the statistics from the destination topic
There is no API in JMS for querying the broker for stats, that goes against the concept of decoupling the client from each other and the intermediate broker. ActiveMQ does offer a few things that you can use, JMX being the most powerful way to get what you are after but if you don't want to go directly to the JMX API you can use the REST based approach that makes use of the Jolokia project which ActiveMQ embeds to support access to the JMX Mbeans that the broker exposes using REST calls.
Besides the REST option the only other way is to enable the Statistics Broker Plugin to allow you to send targeted messages to the broker to retrieve run time stats using standard JMS code.