tags:

views:

104

answers:

2

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);

I see in the logs that if one broker goes down the connection reconnects to other failover But how & where do i catch this event

+1  A: 

Ok transportlistener needs to be set on the ActiveMQConnection

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

Now the transportresumed and other callbacks occur.

Moony
A: 

The transportInterrupted/Resumed is not getting called when the Ethernet cable is plugged OUT. It is called when a graceful shutdown is done to the broker..

vani