Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 27218 invoked from network); 21 Dec 2009 14:06:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Dec 2009 14:06:52 -0000 Received: (qmail 73643 invoked by uid 500); 21 Dec 2009 14:06:52 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 73581 invoked by uid 500); 21 Dec 2009 14:06:52 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 73570 invoked by uid 99); 21 Dec 2009 14:06:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Dec 2009 14:06:52 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.218.211 as permitted sender) Received: from [209.85.218.211] (HELO mail-bw0-f211.google.com) (209.85.218.211) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Dec 2009 14:06:42 +0000 Received: by bwz3 with SMTP id 3so4232340bwz.36 for ; Mon, 21 Dec 2009 06:06:21 -0800 (PST) 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 :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=rzjvlDt0MzZ42NExNhibaNN296sElEKfKZsZB9knlIg=; b=K6p3p65ZwSLQHGBF3VSpAbr8yg8ZMzaEAfiv6ip+94X0WMfjgS8vkU5BTm2nlXvAOb GfvNYNbFK+D7hSvaKoKqvsf+ZJ/PqJdZioUKgskDKfy/UBBwVwQ+k6YrKD+hBK8ptnZ+ OpOaKiXS3om517VKudQaJBD+m6wn4/sMOZS/s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=PJ/TsY8Avhw439dfXo1fF6IfMtq7qUAiKdNb7yl8dbuKhCjzgRN1hUjGM6PYcr/7bO Q9KAwTCFGyJyfs8N33skncMCEwPBme0TrOZea5Q30JEZIsgKXto8UhQwxCABbqvFDHJn JWe5EGCQDUcdrRndUme81cLyGi7fBCrK0swRw= MIME-Version: 1.0 Received: by 10.204.152.151 with SMTP id g23mr4817011bkw.148.1261404381294; Mon, 21 Dec 2009 06:06:21 -0800 (PST) In-Reply-To: <26873948.post@talk.nabble.com> References: <26873948.post@talk.nabble.com> From: Claus Ibsen Date: Mon, 21 Dec 2009 15:04:19 +0100 Message-ID: <5380c69c0912210604x7311320cw1027d82f34f5d125@mail.gmail.com> Subject: Re: How does an aggregator behave with multiple consumers? To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Mon, Dec 21, 2009 at 2:27 PM, ee7arh wrote= : > > Hi, > > When you have a route with mutliple concurrent consumers and this route > contains an aggregator, does the aggregator aggregate messages from all > consumer threads or is there in effect a separate aggregator per consumer > thread? > > I have following route which is currently set to 1 concurrentConsumer. Ca= n I > safely increment this to a higher value knowing that all messages which g= o > through the route will be aggregated together as necessary or does each > concurrent consumer start it's own aggregator in which case a total redes= ign > is required? > > =A0from("activemq:queue:NotificationsToSend?maxConcurrentConsumers=3D1&co= ncurrentConsumers=3D1") > =A0=A0 =A0 =A0 =A0 =A0 =A0.to("bean:" + NotificationsHandler.serviceName = + > "?method=3DsendNotification") > =A0=A0 =A0 =A0 =A0 =A0 =A0.to("bean:" + NotificationsHandler.serviceName = + > "?method=3DsaveNotificationData") > > =A0=A0 =A0 =A0 =A0 =A0 =A0// Aggregate by IdHeader to group the exchanges= together > =A0=A0 =A0 =A0 =A0 =A0 =A0.aggregate(header("IdHeader"), new > GroupedExchangeAggregationStrategy()) > > =A0.completionPredicate(header("aggregated").isEqualTo(header(Handler.EXP= ECTED_NOTIF_HEADER))) > > =A0=A0 =A0 =A0 =A0 =A0 =A0// Update the notification status accordingly > =A0=A0 =A0 =A0 =A0 =A0 =A0.to("bean:" + SchedChgHandler.serviceName + > "?method=3DupdateNotificationStatus"); > > Thanks and BRegards > Andrew > Hi You can ask the computer :) And try it out. But the answer is: there is one instance of the Aggregator so they will all get aggregated, no matter how many concurrent consumers you have. > -- > View this message in context: http://old.nabble.com/How-does-an-aggregato= r-behave-with-multiple-consumers--tp26873948p26873948.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > --=20 Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus