Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 45930 invoked from network); 3 Jul 2008 16:24:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jul 2008 16:24:50 -0000 Received: (qmail 1445 invoked by uid 500); 3 Jul 2008 16:24:26 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 1430 invoked by uid 500); 3 Jul 2008 16:24:26 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 1413 invoked by uid 99); 3 Jul 2008 16:24:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2008 09:24:25 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2008 16:23:34 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1KERb8-0005Rk-C4 for users@activemq.apache.org; Thu, 03 Jul 2008 09:23:54 -0700 Message-ID: <18263153.post@talk.nabble.com> Date: Thu, 3 Jul 2008 09:23:54 -0700 (PDT) From: fl To: users@activemq.apache.org Subject: PrefetchSize doesn't work. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: flower@intercel.com.pl X-Virus-Checked: Checked by ClamAV on apache.org Hello, I have trouble with disabling prefetch buffer for consumers. I made simple test. This is my configuration (i tried the same with values = 0): ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616?jms.prefetchPolicy.all=1&jms.optimizeMessageDispatch=false"); Destination destination = new ActiveMQQueue("queue.TEST?consumer.prefetchSize=1"); There is one producer (Producer) and two consumers (ConsumerA, ConsumerB). All consumers and producers are connected to the same queue 'destination'. All consumers and producers are created at begin of the test. So before Producer send a any message, both consumers are ready for receiving messages. MessageConsumer#receive() method is used for receiving. At this point, Producer send 10 messages. Then ConsumerA tries to get as much messages as possible from queue, and it gets 5 messages. Then ConsumerB tries to get as much messages as possible from queue, and it gets 5 messages too. My question is: why ? :) I expected that 9 messages will be consumed by ConsumerA and 1 message by ConsumerB. Instead, its looks like ConsumerB blocks 5 messages for itself, when it should be able to block only one message (according to prefetchSize). I tried various combination with these three parameters showed above and it is always the same behavior. I check 'PrefetchSize' for these subscriptions via JMX console just before any receiving (so there were 10 messages in queue). 'PrefetchSize' was set to 1 for both subscriptions. It was strange because 'PendingQueueSize' for these subscriptions was set to 4. It looks like 1 message in prefetch cache and 4 messages in pending queue gives our 5 messages that were blocked by ConsumerB. And two additional question: 1) 'PendingQueue' - what it actually is ? 2) Is there any way to set these parameters in xml configuration file? So all ConnectionFactory'ies created without explicitly overwriting will use values from xml. BR, Lucas -- View this message in context: http://www.nabble.com/PrefetchSize-doesn%27t-work.-tp18263153p18263153.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.