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 conn开发者_StackOverflow中文版ection reconnects to other failover But how & where do i catch this event
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.
The transportInterrupted/Resumed is not called when the Ethernet cable is unplugged. It is called when a graceful shutdown is done to the broker..
精彩评论