activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JRR <>
Subject How can a producer/consumer tell if its connection is still good?
Date Sat, 10 Dec 2011 00:25:45 GMT

I am using the Active MQ CPP 3.4.0 client.

We have a multi-threaded application that has multiple producers, and they
share a single connection. These connections are */not/* fail over
connections, nor can they be.

I'm trying to find the fastest, most efficient way to determine if a
connection is still up? For example, consider if the broker was up, then my
application starts, and establishes its connection and sends a few messages.
Then later the broker restarts. So, I need to reestablish the connection.

What I've done so far is get the cached connection. And then try to create a
session on it. If the session create throws an exception, I create a new

However, this feels clunky/kludgy.

Is there a better way to do this?

Oh, I did look at advisory messages, but there isn't an advisory for
creating the connection, there's an advisory for start and stop.

Thank you,


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message