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.


<route routePolicyRef="routePolicy"
shutdownRunningTask="CompleteCurrentTaskOnly" id="ProcessCSVToDB">
    <from
uri="file:///C:\FS\auth\processing\?readLock=changed&amp;readLockTimeout=10000&amp;include=.*xml&amp;moveFailed=C:\FS\auth\error\&amp;move=C:\FS\auth\complete\&amp;charset=utf-8&amp;sendEmptyMessageWhenIdle=true&amp;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.

Reply via email to