qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hamid.Shahid" <hamid2...@hotmail.com>
Subject QPID (JMS) - What is the best way to check if the connection is still valid?
Date Mon, 28 May 2012 10:28:24 GMT
Hi,

I am using Qpid in a java application (JMS). I am creating a connection
object to connect with the borker and to read messages from the queue, I am
using MessageListener. Everything is working fine. When I lose the
connection with the broker, the qpid logs the exceptions and tries to
reconnect with broker again until it connects and everything starts to work
fine again.

But, I want to log some extra logging from a seprate thread while qpid is
trying to reconnect and somehow the connection object never get null and the
qpid exceptions are not breaking the thread. So, is there a way I can check
the current status of the connection? 

The only way I found is the try to create a new temp session in the thread
and if it fails I do the logging and if it does not I close the temp
session. But I think it is not the best way, since it will create a temp
session in the thread every 30sec.

Please let me know, how can I get the connection status.

Thank you.

- Hamid.

--
View this message in context: http://qpid.2158936.n2.nabble.com/QPID-JMS-What-is-the-best-way-to-check-if-the-connection-is-still-valid-tp7578072.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message