It is doesn't complete until after some 20,000 calls, I confirmed that is correct. However, the oldEchange is null for every single one of them.
On 11/29/12 4:22 AM, "Claus Ibsen" <[email protected]> wrote: >oldExchange is null on the 1st call. > >Maybe you completion triggers because there is only 1 exchange in the >batch. > > >On Thu, Nov 29, 2012 at 12:09 PM, Jason Chaffee <[email protected]> >wrote: >> I have a custom aggregator strategy but for some reason the oldExchange >>is always null. Any ideas? >> >> >> Here is my route. >> >> from("seda:Split") >> .routeId("Split") >> .aggregate(new MyAggregationStrategy()) >> .constant(true) >> .completionFromBatchConsumer() >> >>.completionPredicate(header("CamelBatchComplete").isEqualTo(true)) >> .to("file://./target/?fileName=aggregated.xml") >> >> >> Here is my AggregationStrategy: >> >> @Override >> public Exchange aggregate(final Exchange oldExchange, final >>Exchange newExchange) { >> MyObjects c = new MyObjects(); >> >> if (oldExchange != null) { >> C = oldExchange.getIn().getBody(MyObjects.class); >> } >> >> final Message newIn = newExchange.getIn(); >> final MyObject myObject= >>newExchange.getIn().getBody(MyObject.class); >> >> c.addMyObject(myObject); >> newIn.setBody(c); >> >> return newExchange; >> } > > > >-- >Claus Ibsen >----------------- >Red Hat, Inc. >FuseSource is now part of Red Hat >Email: [email protected] >Web: http://fusesource.com >Twitter: davsclaus >Blog: http://davsclaus.com >Author of Camel in Action: http://www.manning.com/ibsen >
