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

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

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