Activemq transportlistener how to use

I am using two brokers and create a consumer connection like this

 ccf = new ActiveMQConnectionFactory(new URI("failover://(tcp://0.0.0.0:61617,tcp://0.0.0.0:61618)"));
 ccf.setTransportListener(this);

      

In the logs I see that if one broker goes down, the connection reconnects to another failure But how and where will I catch this event

+2


a source to share


2 answers


For ActiveMQConnection transponders, you must set the transport identifier Ok

 cc = ccf.createConnection();
 cc.start();
 ActiveMQConnection acc = (ActiveMQConnection) cc;
 acc.addTransportListener(this);

      



Transportresumed calls and other callbacks now occur.

+1


a source


TransportInterrupted / Resumed is not called when Ethernet cable is disconnected. It is called when a graceful completion is made for the broker.



0


a source







All Articles