java - Can I have my JMS topic notify the publisher when a new subscriber connects (using ActiveMQ) -



java - Can I have my JMS topic notify the publisher when a new subscriber connects (using ActiveMQ) -

the utilize case want send configuration info subscribers connect.

initialcontext ic = new initialcontext(); topicconnectionfactory cf = (topicconnectionfactory)ic.lookup("java:comp/env/jms/xxx"); topic topic = (topic) ic.lookup("java:comp/env/jms/xxx"); topicconnection conn = cf.createtopicconnection(); topicsession session = conn.createtopicsession(false, session.auto_acknowledge); messageproducer producer = session.createproducer(topic);

you can you're looking consuming activemq's advisory messages, published when (among other things) consumer connects or disconnects.

java jms activemq

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -