开发者

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

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..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜