activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: status of connection
Date Tue, 27 Jun 2006 10:04:45 GMT
OK so briefly; either a connection is started, closed or in a process
of reconnection. The granularity is at the connection level. e.g. if a
connection is in a period of auto-reconnection, then all the resources
associated with it (sessions, producers, consumers) are blocked until
the connection can be re-established.

So there's no real need to look at individual
session/producer/consumer objects - just the connection will do. Once
a connection is back again, all sessions/producers/consumers are
re-started again and any in-flight messages/acks resent.

If you want more fine grained control to watch the status of the
connection, try...

or in particular...

which lets you watch a transport, the exceptions and be notified when
the transport is interupted (due to disconnection) and resumed.

On 6/24/06, massive.boisson <> wrote:
> Ok, on second look I found:
> ActiveMQConnection.isClosed(), isClosing(), isStarted()
> and
> ActiveMQSession.isRunning().
> So my idea of checking status of connection and session is kinda possible,
> but:
> If session is running, does it mean that it is generally alive? Or does it
> mean that it is currently consuming or producing messages. Also, does it
> imply that producer/consumer/messagelistener it holds is well?
> Finally, can I call isRunning on session from thread  running the
> connection, thus not knowing if another method is being executed? (because
> of this: "The close method is the only session method that can be called
> while some other session method is being executed in another thread.")
> Wow am I confused.
> -- MB
> --
> View this message in context:
> Sent from the ActiveMQ - User forum at



View raw message