activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmurar01 <nm1...@gmail.com>
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.

<destinationPolicy>

            <policyMap>

              <policyEntries>

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

                  <pendingSubscriberPolicy>

                    <vmCursor />

                  </pendingSubscriberPolicy>

                </policyEntry>

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

                  <!-- Use VM cursor for better latency

                       For more information, see:

                      

                       http://activemq.apache.org/message-cursors.html

                      

                  <pendingQueuePolicy>

                    <vmQueueCursor/>

                  </pendingQueuePolicy>

                  -->

                </policyEntry>

              </policyEntries>

            </policyMap>

        </destinationPolicy>


However, this works fine while running a jUnit Test.

BrokerService broker = new BrokerService();

                broker.setBrokerName("fast");

               
broker.getSystemUsage().getMemoryUsage().setLimit(64*1024*1024);

                //Set the Destination policies

                PolicyEntry policy = new PolicyEntry();

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

                policy.setMemoryLimit(4 * 1024 *1024);

                policy.setUsePrefetchExtension(false);

                //disable flow control

                policy.setProducerFlowControl(false);

                PolicyMap pMap = new PolicyMap();

                //configure the policy

                pMap.setDefaultEntry(policy);

                broker.setDestinationPolicy(pMap);

                broker.addConnector("tcp://localhost:61618");

                broker.start();

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 <nm1976@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
> 
> 

-- 
View this message in context: http://old.nabble.com/prefetch-buffer-along-with-acknowledgement-mode-tp29292780p29297760.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message