you can do that by different ways if your messages are non persistent this can be done by subscribing to the topic "ActiveMQ.Advisory.NoConsumer.Queue" or if persistent by subscribing to topic "ActiveMQ.Advisory.MessageDelivered.Queue" or "ActiveMQ.Advisory.MessageConsumed.Queue" to be notified if the message was delivered or consumed after your send ( org.apache.activemq.advisory.AdvisorySupport.getMessageConsumedAdvisoryTopic(Destination) ) do not forgot to enable these advisories all doc & examples are here Advisory http://activemq.apache.org/advisory-message.html
Kind regards. *BENNOUR HASSEN* *SOA **Architect **/ **Java **Software Engineer* 2016-09-02 6:26 GMT+02:00 Robert C <z214...@lanl.gov>: > I have an app that submits JMS messages to a queue. I'd like to check that > there is a consumer listening on teh other side when I submit. If not, I'd > like to raise a warning to the callilng program. Is there a java call that > will tell me how many consumers are subscribed to a queue after I connect > to > it? > > I know I can see this from the UI, but I want to do this via java while > submitting msgs. > > Thanks! > > > > -- > View this message in context: http://activemq.2283324.n4. > nabble.com/How-do-I-check-for-a-queue-consumer-via-java- > after-making-the-connection-tp4716095.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >