Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 80187 invoked from network); 5 Nov 2007 13:56:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Nov 2007 13:56:17 -0000 Received: (qmail 79704 invoked by uid 500); 5 Nov 2007 13:56:05 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 79639 invoked by uid 500); 5 Nov 2007 13:56:05 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 79630 invoked by uid 99); 5 Nov 2007 13:56:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2007 05:56:05 -0800 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 james.strachan@gmail.com designates 209.85.132.246 as permitted sender) Received: from [209.85.132.246] (HELO an-out-0708.google.com) (209.85.132.246) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2007 13:56:06 +0000 Received: by an-out-0708.google.com with SMTP id b8so235452ana for ; Mon, 05 Nov 2007 05:55:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; 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; bh=b7DUFP70TSZyOsnWqcfI4nZEAiQQUlW7QYfyPtjYc8E=; b=ptzlWBc1xr5m4bKsmKVRh4bTmc+JxM2aAdUGvX/XdAR/h51b7ZAqM3I7fqd4ZE3D904x9FGc7VZAJeYmdX4RHTkboGzzNm2/c5Xz//zlYkHezcTlNP6SDdRUaUPT1zdZIez//AViC7xp7r3c7tIpE29f/RRKuJiOIk+1KzT8KBk= 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=WGT54OtcGGUEJ3YHyIazT5QA/8vN4eWsTfyNqZOrzQaP0FzWYT5uvT/cHr/LevZpTeU8IDmnHYxOHoLthd/TVRaOgLU2mPqztmNtTielpeCK58kmqxw3eoKouMrC5tnzwKVTeXD/clwU54OHFF3gVAUfrLwV0JB7AUocDqyWSak= Received: by 10.90.63.16 with SMTP id l16mr3476470aga.1194270945419; Mon, 05 Nov 2007 05:55:45 -0800 (PST) Received: by 10.90.67.7 with HTTP; Mon, 5 Nov 2007 05:55:45 -0800 (PST) Message-ID: Date: Mon, 5 Nov 2007 13:55:45 +0000 From: "James Strachan" To: camel-user@activemq.apache.org Subject: Re: Aggregator strategies (again) In-Reply-To: <13584751.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <13584751.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi Alberto! On 05/11/2007, almilo wrote: > Hi all: > > First, Camel is a very interesting project. Congrats to the team!! Many thanks! :) > Now the question... > > I=B4ve seen a post about better support for Aggregator pattern but with n= o > answer. The testcases seem to be very simple and I think this is a really > relevant pattern for distributed processing. But, being based in "a prior= i" > batch size and timeout it lacks value for most of the uses I can think of= . Yeah! That design BTW was done purely to work nicely with JMS transactions. There are other designs and use cases in the Aggregator space though! :) > Any plans for an Aggregator face-lift? :) We love contributions! :) http://activemq.apache.org/camel/contributing.html > I attach an imaginative testcase :O) with some comments on FIXMEs I wonder if we could create a StreamAggregator that works kinda like the StreamResequencer that Martin Krasser contributed; where rather than using a batch size, the aggregator could use some counters on the message to know how many messages to consume before completing the aggregation window? Another approach is to persist the message state to a database to store the previous state then using some kind of predicate to determine when the aggregation has been completed so that it can be sent. e.g. if you want to split an Invoice message into LineItems then later on aggregate it; you might want to store the LineItems in some persistent table somewhere and only send the aggregated Invoice message when all the LineItems have been received. This is a little like the BAM stuff... http://activemq.apache.org/camel/bam.html --=20 James ------- http://macstrac.blogspot.com/ Open Source SOA http://open.iona.com