Consumer Count / pending Message Count from Queue + ActiveMQ + Java
I have to develop the Utility in Java which will use the ActiveMQ API to get the properties of Queue/Topic to get the No of Consumers / No of Pending Messages and also is there any way I can delete any Message thru Code from Queue ?
I would recommend to use the Statistics Plugin to get the consumer count, pending counts etc. About deleting/removing any particular message from queue, I would recommend not to do that in a separate program but just let your message consumers handle such messages. That would be more maintainable approach I think.
All the below details are with respect to Queue API of ActiveMQ, you can find similar things for topic as well No of Pending messages can be found by using getMessages().size() No of consumers can be found by getConSumers().size() yes , we can delete messages onto queue from Java code, but we need MessageReference or the messageId or a suitable message Selector for this to happen, you can have a look at official documentation of removeMessage(...) and removeMatchingMessages(...) here hope this helps! Good luck!
ActiveMQ 5.5: Not able to get the DLQ_DELIVERY_FAILURE_CAUSE_PROPERTY value
How do I specify the JMX port for an embedded activemq instance?
How do I ensure a topic is removed from an ActiveMQ broker
Why would I use Apache ServiceMix over just ActiveMQ
How to set the ActiveMQ redeliveryPolicy on a queue?
Apache Camel inOut routes, out exchange marshaling/unmarshaling with jaxb
STOMP Protocol - Session ID Questions
What solution should I use for this webapp with websockets. ActiveMQ?
NIO disadvantages in ActiveMQ
How can I programatically purge an ActiveMQ queue using the Apache.NMS API?
Using Camel to transparently log messages from queue
ActiveMQ and JMS : Basic steps for novice
URL Encoding a Camel Exchange Body
Where can I download ActiveMQ Source Distributions?
activemq embedded broker
How to debug ActiveMQ client?