Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 48787 invoked from network); 23 Jun 2009 14:11:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Jun 2009 14:11:41 -0000 Received: (qmail 13593 invoked by uid 500); 23 Jun 2009 14:11:51 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 13542 invoked by uid 500); 23 Jun 2009 14:11:51 -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 13510 invoked by uid 99); 23 Jun 2009 14:11:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jun 2009 14:11:46 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bruce.snyder@gmail.com designates 209.85.220.218 as permitted sender) Received: from [209.85.220.218] (HELO mail-fx0-f218.google.com) (209.85.220.218) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jun 2009 14:11:36 +0000 Received: by fxm18 with SMTP id 18so122156fxm.38 for ; Tue, 23 Jun 2009 07:11:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=izj5UNgWF016pG8TB7uKIW7Rf5nmIMLI8aqqhhfm6bI=; b=LeKh29pIwyeQS7VGUs8OkrqEaWd3cfsZXqhnw2jGzy95Ukg8VM9hlxEEC0fbZ/gkYf p5Ezw2rcbsvDzoAwJ95KTCF0I52j27rCPeLycL8M5xWVkXq82LSahLXp5dFRrmnKdyGc jHGq5UergHAUfEte9h1M8RdjwjsTQqQggf5jo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=p9uaf9P+2VWDEZ9pQ0BRuFQPgxsmBzl3V9BMunFkYLX33uIqqOHqS1tXr6ixZ/wxTx b8/KHUfRBRCcaEnRwr6ncnfPgsBnWhG9DvsbjzoOF6h/UAlHG5mRH2Gy1tpH5qvUogdP AjxqXqWIUytImbWzFUoX/UvGYPn4vMmupqJcQ= MIME-Version: 1.0 Received: by 10.223.107.9 with SMTP id z9mr196298fao.1.1245766274155; Tue, 23 Jun 2009 07:11:14 -0700 (PDT) In-Reply-To: <1833506.211431245735453289.JavaMail.coremail@bj163app57.163.com> References: <24145146.post@talk.nabble.com> <1833506.211431245735453289.JavaMail.coremail@bj163app57.163.com> Date: Tue, 23 Jun 2009 08:11:14 -0600 Message-ID: <7b3355cb0906230711x7126deaav17cde8d3898d9257@mail.gmail.com> Subject: Re: Load Balancing in ActiveMQ From: Bruce Snyder To: users@activemq.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 2009/6/22 lzr : > Try this way: > > Three brokers: b1, b2 and b3; with Queue named q1; > Config networkConnectors from b1 to b2 and b3; > For the Queue q1, run consumer application on b2 and b3; The messages put into q1 will be dispatched to b2 and b3 in same weight. > > I tried this configuration and found it worked well. This is a network of brokers: http://activemq.apache.org/networks-of-brokers.html In a network of brokers, messages are not load balanced across the brokers. However, by default, ActiveMQ uses a round robin dispatch policy so that active consumers on a destination get an equal distribution of messages. Messages are distributed across the brokers based on demand from active consumers on q1 on each broker. But note that if there are no consumers on q1 on a given broker, messages will not be distributed there. Additionally, each consumer's prefetch limit will play a part in message distribution as well: http://activemq.apache.org/what-is-the-prefetch-limit-for.html Bruce -- perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E