qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajith Attapattu <rajit...@gmail.com>
Subject Re: QPID (JMS) - What is the best way to check if the connection is still valid?
Date Mon, 28 May 2012 17:34:39 GMT

At the moment JMS provides transparent failover. Therefore you will only
get notified (via the exception listener) if you cannot reconnect
Since these reconnects are transparent to the application, I wonder why you
want to log them?

If you really want to go that route, you could turn off transparent
failover using failover='nofailover' in the connection URL.
This will allow you to reconnect manually instead of letting the client do
it and you could easily do you logging.

Another potential option is to look at what QMF might offer.
QMF (the management framework) *may* provide events if a connection is lost
under certain circumstances.
Ex. network issue.  However it will not provide events if the broker being
connected to dies.

Hope this helps.


On Mon, May 28, 2012 at 6:28 AM, Hamid.Shahid <hamid2418@hotmail.com> wrote:

> 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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message