Hi,
I am facing one issue when   failover is happening 
There are two clustered brokers using cman. There is this producer program
which is sending message to the exchange.  The program has 4 threads each
having its own session, from which a MessageProducer is created. In this
thread, there is main loop which is sending messages. 
>From the log what i see is that,  One of the session/thread gets this
exception when failover happens. The failover is enabled at connection level
set to failover_exchange. There are three other sessions which also are
derived from the same connection. I see that when failover happens, it
resubscribes the sessions. But one of the session gets this exception and
seems like thread is exiting. I have connection listener enabled. 
My question is how do i catch this exception and then resubscribe this
session myself.



javax.jms.JMSException: Exception when sending message:Session sync was
interrupted by failover.
IoReceiver - /localhost:6002 2012-07-18 14:08:04,581 INFO
[qpid.jms.failover.FailoverExchangeMethod] ================================
============================
        at
org.apache.qpid.client.BasicMessageProducer_0_10.sendMessage(BasicMessageProducer_0_10.java:241)
        at
org.apache.qpid.client.BasicMessageProducer.sendImpl(BasicMessageProducer.java:475)
        at
org.apache.qpid.client.BasicMessageProducer.send(BasicMessageProducer.java:315)
        at
com.tools.jms.selector.GenericProducer.sendMessages(GenericProducer.java:68)
        at
com.tools.jms.selector.GenericProducer.run(GenericProducer.java:102)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.qpid.transport.SessionException: Session sync was
interrupted by failover.
        at
org.apache.qpid.transport.Session.checkFailoverRequired(Session.java:768)
        at org.apache.qpid.transport.Session.sync(Session.java:797)
        at org.apache.qpid.transport.Session.sync(Session.java:779)
        at
org.apache.qpid.client.BasicMessageProducer_0_10.sendMessage(BasicMessageProducer_0_10.java:234)

IoReceiver - /localhost:6002 2012-07-18 14:08:04,581 INFO
[qpid.jms.failover.FailoverExchangeMethod] FailoverAllowed true
Done:20120718 140804,581
IoReceiver - /localhost:6002 2012-07-18 14:08:04,581 INFO
[qpid.jms.failover.FailoverExchangeMethod] ================================
============================
IoReceiver - /localhost:6002 2012-07-18 14:08:04,582 INFO
[qpid.jms.failover.FailoverExchangeMethod] No delay between connect retries
, use tcp://host:port?connectdelay='value' to enable.
IoReceiver - /localhost:6002 2012-07-18 14:08:04,591 INFO
[qpid.jms.failover.FailoverExchangeMethod] ================================
============================
IoReceiver - /localhost:6002 2012-07-18 14:08:04,591 INFO
[qpid.jms.failover.FailoverExchangeMethod] Attained connection 
IoReceiver - /localhost:6002 2012-07-18 14:08:04,591 INFO
[qpid.jms.failover.FailoverExchangeMethod] ================================
============================
IoReceiver - /localhost:6002 2012-07-18 14:08:04,593 INFO
[apache.qpid.client.AMQConnectionDelegate_0_10] Resuming connection
IoReceiver - /localhost:6002 2012-07-18 14:08:04,593 INFO
[apache.qpid.client.AMQConnectionDelegate_0_10] Resubscribing sessions = [o
rg.apache.qpid.client.AMQSession_0_10@78979f67,
org.apache.qpid.client.AMQSession_0_10@2a62610b,
org.apache.qpid.client.AMQSession_0_10@20d
12eea, org.apache.qpid.client.AMQSession_0_10@55f157b,
org.apache.qpid.client.AMQSession_0_10@257b40fe] sessions.size=5
Dispatcher-Channel-0 2012-07-18 14:08:04,635 INFO
[qpid.jms.failover.FailoverExchangeMethod] Failover exchange notified
cluster membership 
change
Dispatcher-Channel-0 2012-07-18 14:08:04,635 INFO
[qpid.jms.failover.FailoverExchangeMethod]
==============================================
==============
Dispatcher-Channel-0 2012-07-18 14:08:04,635 INFO
[qpid.jms.failover.FailoverExchangeMethod] Updated cluster membership
details
amqp://guest:********@test/test?sync_publish='persistent'&brokerlist='tcp://host2:6002'&failover='failover_exchange'&sync_publish='persisten
t'
Dispatcher-Channel-0 2012-07-18 14:08:04,635 INFO
[qpid.jms.failover.FailoverExchangeMethod]
==============================================
==============

--
View this message in context: 
http://qpid.2158936.n2.nabble.com/Where-to-handle-Exception-thrown-when-Failover-is-happening-tp7579841.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to