Hi, It seems that qpid client handle a connection failover for you, so you got the exception with little delay.
>Question 1 - How can I change this timer in my code - set it to 1 seconds or >so? You can use heartbeats: http://qpid.apache.org/books/0.12/Programming-In-Apache-Qpid/html/ch03s02.html#section-jms-connection-url or reconnect options: https://cwiki.apache.org/qpid/connection-url-format.html >Question 3 - My code does blocking on messageConsumer.receive() I'm not sure, but try to use heartbeats. Regards, Boris -----Original Message----- From: dmounessa [mailto:[email protected]] Sent: Thursday, November 17, 2011 11:37 PM To: [email protected] Subject: Handling Broker Disconnects on JAVA Client I have a JAVA client that creates a Durable Queue to send and receive messages from C++ Broker. When the senders tries to JAVA MessageProducer sending a message and I kill the broker, I see the following log message from qpid.client. 12:54:43.032|SEV|org.apache.qpid.client.AMQConnectionDelegate_0_10|connection exception: conn:43684706| But it take one minute before it comes out and let me know that the connection is broken via JMSException -- Producer|NODE0|javax.jms.JMSException: Exception when sending message| Question 1 - How can I change this timer in my code - set it to 1 seconds or so? Question 2- Soon I would like to create two brokers on two different servers where if one goes down, the client uses the other one. I save in C++ code that this could be handled in the client -- How would I do this in my JAVA code and do I need to maintain the connections? And if there is a broker list, will the MessageProducer.send(message); send the message to one and if it failed, it would fail over to the next one? Question 3 - My code does blocking on messageConsumer.receive() - when I restarted the Broker, I see the following message in the logger - but the API does not time out, and if I start the senders to send, it never returns with the next message -- I am not sure why I do not get JMS Exception in the JAVA client. What do I need to do to handle the broker disconnects on the receive()? 12:59:28.819|SEV|org.apache.qpid.client.AMQConnectionDelegate_0_10|connection exception: conn:5c95da38| Thanks for your help. -- View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/Handling-Broker-Disconnects-on-JAVA-Client-tp7005439p7005439.html Sent from the Apache Qpid users mailing list archive at Nabble.com. --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:[email protected] _______________________________________________________ The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. If you need assistance please contact our Contact Center (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:[email protected]
