camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atg roxx <atgr...@gmail.com>
Subject onException with Throwable.class
Date Mon, 13 Apr 2015 10:45:05 GMT
Hi Team,

While working on my camel project and noticed (a bug perhaps ) that when
you add onException(Throwable.class) to your route, all exception go to
this onException(Throwable.class) block.

Problem is explained in below scenerio.


Scenerio 1 :  does not work .   onException(IrrecoverableException.class,
Throwable.class) is called.
---------------------------------------------
  onException(*RecoverableException*.class)
                .maximumRedeliveries("3")
                .redeliveryDelay("1000")
                .end();

    // this block is to capture any runtime or other exception
  onException(*IrrecoverableException*.class, *Throwable*.class)
                .log(LoggingLevel.WARN, "Irrecoverable error");



from("direct:start")
              .throwException(new RecoverableException("recoverable
exception"))
               .end();

------------------------------------------------------------------------


Scenerio 2 :  This works fine and onException(RecoverableException.class)
is called
-------------------------------------------------------------------------
  onException(*RecoverableException*.class)
                .maximumRedeliveries("3")
                .redeliveryDelay("1000")
                .end();

     // this block is to capture any runtime or other exception
  onException(*IrrecoverableException*.class, *Exception*.class)
                .log(LoggingLevel.WARN, "Irrecoverable error");



from("direct:start")
              .throwException(new RecoverableException("recoverable
exception"))
               .end();

------------------------------------------------------------------------


Could you explain the why this is happening or I am doing anything wrong




-Regards
atg roxx

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message