On Thu, Dec 6, 2012 at 11:56 PM, Christian Müller <christian.muel...@gmail.com> wrote: > It would be great to improve the Aggregator to support a completion size > which evaluates ALL exchanges (from all different aggregates). > We ofter have the requirement to split a file which contains items which we > process independently. At the end, we have to aggregate the items based on > the customer. > > As an example, we have one input file with 1000 items which will result in > 2 output files with 300 and 700 items (or 3 output files with 273, 493, 234 > items - or 4 output files with ... I think you got it). At the end, the > aggregator will receive in total 1000 files which should be trigger a flush > on ALL existing aggregates. >
> What do you think? > Is there already a simple solution for this which I miss? > Yes. The EIPs are composable and you can build solutions like lego bricks. So what you should look at is the composed message processor http://camel.apache.org/composed-message-processor.html ... to do the rough split + aggregate, into eg 2-4 files. And then afterwards you can split. > At present we use a combination of two aggregators to do this. Each will > receive a copy of an item. The second aggregator only counts the total > number of all received exchanges (we are using the same aggragation key > value for this aggregator). If this aggragor flushes the exchange, we send > a "command message" to the first aggregator to flush all the aggregates. > > I think there should be a simpler solution out of the box which Camel > should offer. E.g. completionRepositorySize or repositoryCompletionSize > > Best, > Christian -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen