Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 88069 invoked from network); 6 Feb 2007 09:55:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Feb 2007 09:55:48 -0000 Received: (qmail 82197 invoked by uid 500); 6 Feb 2007 09:55:54 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 82177 invoked by uid 500); 6 Feb 2007 09:55:54 -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 82168 invoked by uid 99); 6 Feb 2007 09:55:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Feb 2007 01:55:54 -0800 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 64.233.184.235 as permitted sender) Received: from [64.233.184.235] (HELO wr-out-0506.google.com) (64.233.184.235) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Feb 2007 01:55:45 -0800 Received: by wr-out-0506.google.com with SMTP id 37so1517883wra for ; Tue, 06 Feb 2007 01:55:24 -0800 (PST) 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=iGFtO3kDS5H/0AYE50vfCr2vk8krmXDdKPYTFmu4G9NE2CAAoNXRSzZyo5WEkCGVTYxj6lOtNfC1XC7UgXPY/3BTJF8BEYI3fEtCrkr/mKnOXM34MS4pLmxqiCidbUFfoLhzF6lejmskFikb+DNyWuKi8pSGhE0a+ZSPjsFrv3U= Received: by 10.78.179.12 with SMTP id b12mr168508huf.1170755722081; Tue, 06 Feb 2007 01:55:22 -0800 (PST) Received: by 10.78.155.11 with HTTP; Tue, 6 Feb 2007 01:55:22 -0800 (PST) Message-ID: Date: Tue, 6 Feb 2007 09:55:22 +0000 From: "James Strachan" To: users@activemq.apache.org Subject: Re: Message Groups and multiple brokers In-Reply-To: <8818152.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: <8818152.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org On 2/6/07, GaryG wrote: > > I started playing around with Message Groups and have a bunch of new > questions: > > 1. If I'm understanding this correctly, Message Groups are tying groupIDs > to a specific consumer of the Queue. However, this mapping is private to > the broker. So, the problem I'm seeing is that if I run 2 brokers, and my > URL is something like this: > url = "failover:(tcp://localhost:61616,tcp://localhost:62616) > > Then I send a bunch of messages that are targeted for msgGroupId=1 or 2 or > 3, and I have 3 consumers running. Ideally what should happen is that each > consumer should get an equal share of messages. And indeed I see this > behavior with only 1 broker. But with 2 brokers, I don't see this happen, > only 1 consumer gets all the messages. Am I missing something?? > > I have persistence turned off in this case. > > Does this mean that MessageGroups only work when there's only one broker, > and don't work in Master-Slave broker configuration?? They work with a single broker or with Master-Slave. But they don't work with networks of brokers. > 2. Similar example to the above, but only 1 broker, 3 consumers. I start > the message sender, and start seeing the messages spread out across the > consumers. Then I kill one of the consumers. One of the 2 remaining > consumers picks up the slack. All is good. > > Now I turn the killed consumer back on, and herein lays the problem. I > never see this consumer get any messages. I've tried the suggested method > of closing the message group with this code: > > System.out.println("closing messageGroupId="+msgGroupId); > Message message = session.createTextMessage("reset"); > message.setStringProperty("JMSXGroupID", msgGroupId); > message.setIntProperty("JMSXGroupSeq", 0); > > producer.send(message); > > But even after I do this, the 3rd consumer never gets any messages, they > continue going to one of the other guys. > > So the question is...if one of the consumers dies, and then comes back > (common scenario), how do I get the broker to forward messages to him once > again?? We don't automatically rebalance things after failures; we're currently hoping that there is a sufficient number of message groups around that things balance fine. (Though closing the message group should work - its just not defined which consumer will get the next message group - so if you keep trying to close them, you should eventually see things settle down). One work around is to just force each consumer to restart periodically to help re-balance things (or close the message groups as you figured out) -- James ------- http://radio.weblogs.com/0112098/