On Tue, Apr 26, 2011 at 1:14 PM, Sorin Silaghi <[email protected]> wrote:
> Hi,
>
>
>      I have the folowing onException configuration in my camel-context.xml:
>
>        <onException>
>            <exception>java.lang.Exception</exception>
>            <redeliveryPolicy maximumRedeliveries="2" />
>        </onException>
>
>      The route uses the file component for pooling. I expect this to try a
> file 3 times and then stop but it actually tries over and over again. I
> tried a few variations but none of them seem to work. Any ideas ?
>

Yes :)

What you do above is for the *current* exchange. So in case of some
exception occurs during processing, you have told Camel to try again
up till 2 times.

So in your case I assume all those attempts *still* fail. So the file
could not be processed at all. The Camel file component will then try
the file again next time it poll (pickup files).

In case you do not want to pickup the file again, you need to either
- use the moveFailed option on the file endpoint
- or use eg the Dead Letter Channel EIP
- or handle the exception in onException, for example move the file or
log something, or whatever you want



>
> Sorin.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
CamelOne 2011: http://fusesource.com/camelone2011/
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to