Dear Listener!

I have a route that starts with a file consumer that has the options 'move'
and 'moveFailed' configured. 
After the file component has given away the file to the subsequent process
an exception is thrown that 
will be handled via the exception policy (onException with handled=false). 
The problem is that the beginning file component does not register the
exception and therefore the csv 
file is always moved to the directory /.done/ instead of /.error/.

How can I notify the file component that the process is failed with the
result to move the csv file to
/.error/? My understanding actually was that the file component should
handle this for itself once 
the option 'move' and 'moveFailed' are configured!? :-(

I am using Apache Camel version 2.9.0. The /Default Error Handler/ is used.

At next you can find the camel route I am talking about:

<camel:endpoint id="fileInEndpoint"
uri="file://[[configDir]]?filter=#Filter&amp;move=.done/${file:name.noext}-${date:now:yyyy_MM_dd_HH_mm_ss}.${file:ext}
&amp;moveFailed=.error/${file:name.noext}-${date:now:yyyy_MM_dd_HH_mm_ss}.${file:ext}&amp;delay=10000"
/>

<camel:onException>
   <camel:exception>java.lang.IllegalArgumentException</camel:exception>
   <camel:exception>javax.validation.ValidationException</camel:exception>
   <camel:to uri="seda:logger" />                       
</camel:onException> 

<camel:route id="readConfig">
    <camel:from ref="fileInEndpoint" />
    <camel:onCompletion>
        <camel:bean ref="reset" method="resetRepo" />
   </camel:onCompletion>
   <camel:setHeader headerName="operationName">
        <camel:simple>Import</camel:simple>
   </camel:setHeader>
  
  <camel:unmarshal ref="bindyDataformat" /> 
  ...
</camel:route>

Many thanks in advanced!

Best regards
Hilde


--
View this message in context: 
http://camel.465427.n5.nabble.com/Component-file-move-and-moveFailed-tp5685631.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to