activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "james strachan (JIRA)" <>
Subject [jira] Commented: (AMQ-1020) Slow consumer terminally blocks both client and broker
Date Thu, 02 Nov 2006 12:11:02 GMT
    [ ] 
james strachan commented on AMQ-1020:

Are you using explicit acknowledgements or auto-ack (or transactions?). The default prefetch
is only about 1000 I think for NMS which means after sending 1000 messages no more messages
will be dispatched to a consumer until it receives acks. So I can see why Client1 becomes
stuck pretty quickly and why client1 can no longer publish more messages.

So 2 things to try...

use dispatchAsync=true (on consumer info) on the consumers, so that dispatching to consumers
is asynchronous in the broker. That way a producer won't get blocked waiting to dispatch to
slow consumers.

Also try upping the prefetch value to something large. e.g. on Java for non-persistent topics
its about 32000 I think

> Slow consumer terminally blocks both client and broker
> ------------------------------------------------------
>                 Key: AMQ-1020
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 4.0.2
>         Environment: Broker: Windows XP, Sun JDK1.5  Client: activemq-dotnet (Trunk)
>            Reporter: Rob Lugt
> I have a multi-threaded client (client1) which is acting as both a publisher (Topic1)
and subscriber (Topic2) using a single session.  There is another client process (client2)
which publishes on Topic2.
> I have witnessed the following repeatable scenario where both clients get stuck, which
can only be rectified by restarting the broker! :-
> Client1 publishes messages to Topic1 (rate = about 30 msgs/sec).
> Client2 publishes bursts of messages to Topic2 (rate = 500 msgs/sec) 
> Client1 is a slow subscriber on Topic2
> After running in this scenario for a couple of seconds, Client1 and Client2 become stuck.
 Looking at a stack trace for Client1 I can see that it's read_loop is stuck waiting for input,
and it's publisher thread is stuck waiting for an acknowledgement to the synchronous message
send (the acknowledgement never arrives because the broker won't sent any more messages).
> Client2 is also stuck waiting for an acknowledgement to a synchronous send.
> My perception is that it appears the broker is throttling the connection because the
consumer is running slowly, but for some reason it gets into a state where all message flow
stops (even though the consumer is automatically acknowledging messages, albeit slowly). 
Furthermore, if I kill Client1 the broker doesn't recover (using a JMX console the connection
remains visible).
> The broker uses a vanilla configuration (i.e. no policies are set for the topics in quedtion).

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message