activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: ActiveMQ behavior when subscriber crashes?
Date Wed, 16 Aug 2006 07:20:07 GMT
On 8/16/06, B-Storm <> wrote:
> I am a newby at using ActiveMQ and therefore I have simple
> questions.

Welcome! :)

>  Maybe I missed a similar post in the forum?
> In the situation where I have a publish - subscibe model... suppose
> I have multiple subscribers consumming the messages. The
> subscriptions are not durable and the messages are not persistent.
> Then one of my subscribers crashes without properly closing the
> session/connection etc. When a subscriber crashes unexpectedly I don't want
> ActiveMQ to try to send anymore message to them. I assume it will
> generate an exception of some sort within the broker.


> 1. What is the behavior of ActiveMQ going to be in this situation?

The broker will kill the connection and not dispatch (or keep around)
any more messages for that consumer

> 2. For all of the message received from the publisher(s) how often
>     will it attempt to send new messages to the crashed subscriber
>     before giving up on it?

Once it decides the connection is dead it stops doing anything for
that client any more.  Typically it stops a connection when the socket
dies. There's also an inactivity timeout applied above the TCP layer
in case your OS doesn't inform Java of sockets terminating fast
enough. You can tweak the socket timeouts etc via the TCP transport...

or specify an inactivity timeout via the wireformat...

BTW the parent page of those links is a handy place to start on as its
got lots of information on how you can configure ActiveMQ using a
simple URI syntax...

> 3. Will this affect the future performance of ActiveMQ's message
>     delivery to the other subscribers?

No. As soon as the connection is closed by the broker its resources
are all discarded. The only real way a subscriber can adversely affect
the broker is by working perfectly but by going very slow compared to
the other subscribers...

> 4. Is there a way to configure ActiveMQ to stop sending messages
>     to crashed clients and close the connection after a certain number
>     of failed attempts (non-durable, non-persistent)?

As soon as connection is closed, the broker disconnects the client.
The client can auto-reconnect if it uses the failover transport...

> 5. Is there a way to be notified of subscribers that are not accepting
>     messages?

You can use JMX to watch the system

or you can use advisories


View raw message