7.4. 在原生模式中使用 onException 子句
当在原生模式下使用 camel onException 处理时,应用程序开发人员负责注册异常类以进行反映。
例如,有一个带有 onException 处理的 camel 上下文,如下所示:
onException(MyException.class).handled(true); from("direct:route-that-could-produce-my-exception").throw(MyException.class);
onException(MyException.class).handled(true);
from("direct:route-that-could-produce-my-exception").throw(MyException.class);
应注册类 mypackage.MyException
进行反映,请参阅 Registering class for reflection。