On Thu, Nov 29, 2012 at 12:09 PM, Jason Chaffee <jchaf...@shopzilla.com> 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") >
You should prefer to use direct endpoint, instead of seda. Also you got 2 completions, can you try with either one. > > 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: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen