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.

Reply via email to