activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmurar01 <>
Subject Re: prefetch buffer along with acknowledgement mode
Date Thu, 29 Jul 2010 16:17:43 GMT

The following entry in my activemq.xml doesn’t seem to work.




                <policyEntry topic=">" producerFlowControl="true"
memoryLimit="1mb" usePrefetchExtension="false">


                    <vmCursor />



                <policyEntry queue=">" producerFlowControl="true"
memoryLimit="1mb" usePrefetchExtension="false">

                  <!-- Use VM cursor for better latency

                       For more information, see:












However, this works fine while running a jUnit Test.

BrokerService broker = new BrokerService();



                //Set the Destination policies

                PolicyEntry policy = new PolicyEntry();

                //set a memory limit of 4mb for each destination

                policy.setMemoryLimit(4 * 1024 *1024);


                //disable flow control


                PolicyMap pMap = new PolicyMap();

                //configure the policy





Gary Tully wrote:
> 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 <> 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:
>> Sent from the ActiveMQ - User mailing list archive at
> -- 
> Open Source Integration

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message