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!
I can't connect 8161/admin when activeMQ replicated levelDB with zookeeper
WSO2 - DAS consuming MQTT messages
How to recover ActiveMQ from full KahaDb persistence store?
How to configure the default ActiveMQ in tomEE
Ruby Stomp Gem #publish seems to truncate messages to 256 characters?
ActiveMQ: how can I deliver all messages in a queue to many consumers?
ActiveMQ broker redelivery vs consumer redelivery
Unable to define correct authorization rules… topic://ActiveMQ.Advisory.Producer.Queue.Q1
Spring web-socket message size
schedule moving of messages from activemq DLQ to another queue in ActiveMQ
Use ActiveMQ 5 and IBM MQ 8 in the same application
ActiveMQ performance for producing persistent text messages
active mq and spring jmstemplate how to properly shut down
How provide reliability of ActiveMQ broker?
XA transaction across two separate resource managers/XAResource's
How can I configure a static network of TomEE embedded ActiveMQ brokers so that clients can communicate?