On trunk, a 5.4-SNAPSHOT, you can disable the prefetchExtension (via a
destination policy, usePrefetchExtension=false) that is responsible
for allowing the buffer to be refilled when a message is delivered.
The consumer send a deliveredAck to the broker to let it know that it
can send more messages in the normal case.

Also note that CLIENT_ACK mode will ack all messages received at that
point, not just the current message. You need to use INDIVIDUAL_ACK if
you want to deal with each message individually.

On 29 July 2010 04:28, nmurar01 <nm1...@gmail.com> wrote:
>
>
>  We are using worker threads to process messages. So, onMessage() calls
> simply return by delegating the processing to the worker thread. Once the
> worker thread processes the message, worker thread calls
> message.acknowledge(). So, if I set a prefetch buffer of 10, and 9 messages
> are getting processed now and 1 finished processing and sent an
> acknowledge(), I would expect only 1 message to show up in my prefetch
> buffer. But, the prefetch buffer gets filled with next message as soon as
> onMessage() completes, not when message.acknowledge() happens.  Why is
> that??? I tried setting ackMode in CLIENT_ACKNOWLEDGE,
> INDIVIDUAL_ACKNOWLEDGE. I even tried session.commit(). Nothing seems to stop
> filling up prefetch buffer.  Any Ideas??? We don't want to avoid using
> receive() or adding multiple consumers by setting prefetchLimit of 1.
> --
> View this message in context: 
> http://old.nabble.com/prefetch-buffer-along-with-acknowledgement-mode-tp29292780p29292780.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Reply via email to