简体   繁体   中英

How to handle an exception in an exception block in apache camel

I am trying to handle an exception within apache camel in onException. Can someone guide me if it is possible?

I have written another onException which will handle all Exceptions, but the flow is not transferred to that exception block

onException(SchemaValidationException.class)
        .to("xslt:stylesheet/example/TransformErrorBlock.xsl?saxon=true")
        .log("Validation error in received message, response sent: ${body}")
        .handled(true);

My expectation is if there is an exception in this block, it should be caught in another onException block

你不能这样设计Camel只允许onException块来处理异常,否则当onException A由onException处理时会导致无限循环,这会导致一个新的异常,然后可以再次由onException A处理,所以无尽的循环圈。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM