activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Mielke <>
Subject Re: Reply:Re: Consumer wait for next batched messages for several seconds?
Date Fri, 02 Sep 2011 12:57:55 GMT
using optimizedAcknowledge will ack all outstanding msgs after either 300ms or 65% of the
prefetch (650 msgs in your case).

With such setting and given your use case, it should not take several seconds before new msgs
are dispatched to the broker. 
Have you tried running the same test locally (with broker and producer/consumer) on the same
physical machine? I wonder if that gets you different results.
If all works fine locally, then its something with your network. 
If you see the same problem when running locally, perhaps try to reproduce the issue using
one of the ActiveMQ demos.
If you can't reproduce it there, it probably something in your application that causes this.

If you have a simple reproducible test case, we could have a look.


On Sep 2, 2011, at 4:47 AM, SuoNayi wrote:

> Yes, messageListener of the only one consumer only prints the message on console .
> The size of message is only 1kb.
> Consumer and broker is in the same LAN(100m).
> The consumer session is not transacted but I have set optimizeAcknowledge to be true.
> The break when consumer wait for next buffered messages takes several seconds, this 
isreasonable or not?
> At 2011-09-01 23:34:20,"Torsten Mielke" <> wrote:
>> you quickly does the consumer process the 1000 msgs and how fast is the network between
broker and consumer?
>> What's the size of the msg? Is the consumer session transacted?
>> In general the broker can prefetch more msgs to your consumer once the consumer has
acked a few msgs. So the broker should try to keep the consumers prefetch full (assuming there
are more msgs on the queue to dispatch). The broker generally does not wait for all the 1000
msgs to be acked, before dispatching more msgs.
>> Torsten Mielke

Torsten Mielke

View raw message