On Tue, Mar 22, 2016 at 1:00 PM, fxthomas <felix.tho...@gmail.com> wrote: > hello, > > I have a below route configuration, my problem is that I don't want camel > to move the file to error Or complete folder incase i throw a custom > exception while processing . But currently it moves the file to complete or > error if I handle the exception true/false. Is there a way to make camel > leave the file as it is in the same folder. I am stopping the route for the > exception "com.exception.FileSequenceException" which works but the file > gets moved, which i want to avoid in this special scenario. >
Why do you want that? If the file is leave as-is then its picked up on next poll and you end up throwing the same exception over and over again. > > <route routePolicyRef="routePolicy" > shutdownRunningTask="CompleteCurrentTaskOnly" id="ProcessCSVToDB"> > <from > uri="file:///C:\FS\auth\processing\?readLock=changed&readLockTimeout=10000&include=.*xml&moveFailed=C:\FS\auth\error\&move=C:\FS\auth\complete\&charset=utf-8&sendEmptyMessageWhenIdle=true&sorter=#customFileSorter"/> > <onException> > <exception>com.exception.ErrorThresHoldException</exception> > <exception>com.exception.InvalidFileException</exception> > <handled><constant>false</constant></handled> > </onException> > <onException> > <exception>com.exception.FileSequenceException</exception> > <handled><constant>true</constant></handled> > <process ref="stopRouteProcessor"/> > </onException> > <onException> > <exception>java.lang.Exception</exception> > <handled><constant>false</constant></handled> > <process ref="stopRouteProcessor"/> > </onException> > <choice> > <when> > <simple>${body} != null</simple> > <to > uri="bean:processorBean?method=processFileMessage(${body},'databasebean')"/> > </when> > <otherwise> > <process ref="stopRouteProcessor"/> > </otherwise> > </choice> > </route> > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Not-move-file-on-custom-exception-thown-file-component-tp5779476.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2