Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 43297 invoked from network); 19 Jun 2007 17:52:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Jun 2007 17:52:07 -0000 Received: (qmail 55123 invoked by uid 500); 19 Jun 2007 17:52:10 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 55099 invoked by uid 500); 19 Jun 2007 17:52:09 -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 55090 invoked by uid 99); 19 Jun 2007 17:52:09 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jun 2007 10:52:09 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of james.strachan@gmail.com designates 66.249.82.224 as permitted sender) Received: from [66.249.82.224] (HELO wx-out-0506.google.com) (66.249.82.224) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jun 2007 10:52:05 -0700 Received: by wx-out-0506.google.com with SMTP id i28so2172765wxd for ; Tue, 19 Jun 2007 10:51:44 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JlI+C6Feo7VDDDgxm73C8qPmPYBNiePbyMoSyPWrCGNZ7xP4QOVhPVpqSQEZWztgD28TK7rPDeg9huY/shDZDtofSVAdVJBHj5Fv9zehJFFcFJlCOXlb660MWmgjL0d3bpGM/TfvpuNcUDuFkDkcJ/bFPU5T9RjiUqBnKLMof+w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ff+QD2PRrnySdRDP/NL4blomcaI/rDM/PztkpL5FU8pm8tn48R5IDBQQdLdjwOW+hlhlnhh7wnV6JnIBgn4N+nDmiXysOsB3JK+d1j30bJHpeg4Gn/9AKptdPDvLMemx8ZxQIbjmL58IxJWkJ+Z4KP1AtUvzNwfUzF/xqsGvTPk= Received: by 10.90.99.20 with SMTP id w20mr5272574agb.1182275504415; Tue, 19 Jun 2007 10:51:44 -0700 (PDT) Received: by 10.90.67.18 with HTTP; Tue, 19 Jun 2007 10:51:44 -0700 (PDT) Message-ID: Date: Tue, 19 Jun 2007 18:51:44 +0100 From: "James Strachan" To: users@activemq.apache.org Subject: Re: Problem with message groups In-Reply-To: <11191679.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <11178578.post@talk.nabble.com> <11191679.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org On 6/19/07, jcm231 wrote: > > > > James.Strachan wrote: > > > > On 6/18/07, jcm231 wrote: > >> > >> Hi! > >> > >> I am have a standalone ActiveMQ server and I am sending messages using a > >> producer. The messages include the JMSXGroupID header with two different > >> values: "one" and "two". I launch two Consumer objects, both being > >> threads > >> and implementing the interface MesageListener. The result is that only > >> one > >> of the two consumers receives all the messages. Sometimes is the first > >> consumer and sometimes is the second who receives them all. > >> > >> What am I doing wrong? It is the first time I use ActiveMQ and I would > >> thank > >> any help anybody could give me. > > > > We don't yet guarrentee an exact round-robin dispatch policy on a per > > message group basis; consumers tend to eagerly grab as many messages > > as will fit into their pre-fetch buffer. > > http://activemq.apache.org/what-is-the-prefetch-limit-for.html > > > > to mimick round-robin, try setting the prefetch to 1 on both > > consumers; or try using thousands of messages > > > > > > > > > > -- > > James > > ------- > > http://macstrac.blogspot.com/ > > > > > > > I have sent 34000 messages but they all get consumed by the same consumer. > > > I tried to specify the prefetchSize as indicated in: > > http://activemq.apache.org/what-is-the-prefetch-limit-for.html > > but I am not creating the ActiveMQQueue on the consumer's code but on the > xml file. So I put this on my activemq.xml file: > > > > > > > example.MyQueue?consumer.prefetchSize=1;consumer.exclusive=false > > > > but it seems not be effective. Creating a queue does nothing, unless you actually use it in your JMS client (e.g. to consume from) If you're struggling to set the prefetch groups; try sending say 50,000 messages to group 1, then start mixing 1 and 2; then the first consumer will get its pre-fetch buffer filled with the first group; so it won't grab group 2. (Or have lots of groups) -- James ------- http://macstrac.blogspot.com/