0

I have following camel configuration:

from("file://" + FTP_FILES + "?idempotent=true")
.process(new Processor() {
     @Override
     public void process(Exchange exchange) throws Exception {
         throw new RuntimeException("test");             
     }
 }).onException(Exception.class).maximumRedeliveries(0);

This code works in infinite loop and tried to process same file.

Is it possible to configure camel just ignore exception?

P.S.

I also tried

.onException(RuntimeException.class).continued(true);

and

.onException(RuntimeException.class).handled(true)

but result the same

P.S.

I just want behaviour same as this code provide:

from("file://" + FTP_FILES + "?idempotent=true")
.process(new Processor() {
     @Override
     public void process(Exchange exchange) throws Exception {
         try{ 
             throw new RuntimeException("test");
         } catch(RuntimeException e){
             // just ignore  
         }             
     }
 })
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710

1 Answers1

0

See this unit test that demonstrates hos this is possible: https://github.com/apache/camel/commit/fcd200c4e13c35bb9a63924bbc3e2d6a643c31cf

The error handler will catch the exception and handle it, and the file consumer will regard the file as processed successfully, and move the file to the .camel sub folder (default behaviour).

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65