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
Post a Comment