Hi Use the shareUnitOfWork option as documented on the Splitter EIP page http://camel.apache.org/splitter
On Fri, Feb 3, 2012 at 1:08 AM, regvito <reggie.v...@transcentra.com> wrote: > I have a consumer file endpoint where I want it to send the file to an error > folder using moveFailed > if there are any errors processing the file. > > I can get a route working that has a splitter where it calls a bean to > process each row in the file. > When that throws an exception, the consumer file endpoint works as expected > and moves the file > being processing to the error folder. Here is a simplified route of this: > <route> > <from uri="file:src/data/?move=.done&moveFailed=.error"/> > <split streaming="true" shareUnitOfWork="true"> > <tokenize token="\n"/> > <bean ref="myTransform" /> > </split> > <to uri="log:ExampleRouter"/> > </route> > > However, when I add an aggregator within the splitter and the bean throws an > exception, > it doesn't work as exptected. It looks like the exception isn't being > propagated somehow > to enable that file being processed to be sent to the error folder. > Here is that simplified route: > > <route> > <from uri="file:src/data/?move=.done&moveFailed=.error"/> > <split streaming="true" shareUnitOfWork="true"> > <tokenize token="\n"/> > <aggregate strategyRef="aggregatorStrategy" > completionSize="1000" > > <correlationExpression> > <simple>1</simple> > </correlationExpression> > > > <completionPredicate> > <simple>${property.CamelSplitComplete}</simple> > </completionPredicate> > > <bean ref="myTransform" /> > > </aggregate> > > </split> > <to uri="log:ExampleRouter"/> > </route> > > Any ideas on how I can move the file being processed into the error folder > when > my bean throws an exception with a route like above with a spiltter and > aggregator? > > -- > View this message in context: > http://camel.465427.n5.nabble.com/problem-propagating-exceptions-with-splitter-and-aggregator-tp5452376p5452376.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/