Hi This is expected as your DLC handles the exception.
So remove that, or do not use it in the file route. You can still use onException to tell Camel to retry up till 10 times. And if its still a problem then the exchange is failed, and the file consumer will use the moveFailed. On Thu, Mar 20, 2014 at 4:43 PM, Olaf <[email protected]> wrote: > Hello, > > In my route below I'd like to move only a successfully processed file into > 'done' folder. If any exception occurs or message is routed to dead letter > channel I want to move the input file into failed folder. I've used > &moveFailed=failed option, but it does not work. The file is just moved to > 'done' folder even if NullPointerException happens in beanRef("processor1", > "step2") part of the route. > > Thanks for help! > > @Override > public void configure() throws Exception { > > errorHandler(deadLetterChannel(direct:dead)); > onException(IOException.class) > .handled(true).maximumRedeliveries(10) > .retryAttemptedLogLevel(LoggingLevel.WARN).redeliveryDelay(10000) > .to(direct:dead); > > > from(file:incoming?preMove=inprogress&move=done/${date:now:yyyy-MM-dd}/${file:name}&moveFailed=failed) > .beanRef("processor1", "step1") > .beanRef("processor1", "step2") > .to("log:done"); > } > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/move-files-if-message-fails-tp5749154.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen Make your Camel applications look hawt, try: http://hawt.io
