Apache camel doTry中camel-choice块中的异常处理
在下面的代码中,谁能解释一下choice块在doTry中的作用,以及为什么它不能捕获RuntimeExceptionApache camel doTry中camel-choice块中的异常处理,apache-camel,Apache Camel,在下面的代码中,谁能解释一下choice块在doTry中的作用,以及为什么它不能捕获RuntimeException <doTry> <process ref="msgProcessor" /> <choice> <when> <simple>"false" == "true" && $
<doTry>
<process ref="msgProcessor" />
<choice>
<when>
<simple>"false" == "true" && ${exchangeProperty.status} == ${ref:SUCCESS}</simple>
<process ref="queryProcessor" />
</when>
</choice>
<choice>
<when>
<simple>"false" == "true" && ${exchangeProperty.status} == ${ref:SUCCESS}</simple>
<process ref="compareProcessor" />
</when>
</choice>
<doCatch>
<exception>org.apache.camel.RuntimeCamelException</exception>
<exception>java.lang.Exception</exception>
</doCatch>
</doTry>
我的猜测是,您的异常没有被try-catch处理,而是被传播回路由的错误处理 发现错误时,请尝试添加一些处理: -设置为true -删除自定义日志 -停止以结束exchange上的处理
这将使确认是否调用了错误处理程序变得非常容易。我的猜测是,try-catch没有处理您的异常,并且正在传播回路由的错误处理 发现错误时,请尝试添加一些处理: -设置为true -删除自定义日志 -停止以结束exchange上的处理
这将使确认是否调用了错误处理程序变得非常容易。我遇到了类似的问题。看起来.doTry()和.choice()不能很好地配合。我也有类似的问题。看起来.doTry()和.choice()不能很好地配合使用。
org.apache.camel.RuntimeCamelException: Scanner aborted because of an IOException!
at org.apache.camel.processor.Splitter$SplitterIterable$1.hasNext(Splitter.java:171)
at org.apache.camel.processor.MulticastProcessor.doProcessParallel(MulticastProcessor.java:268)
at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:225)
at org.apache.camel.processor.Splitter.process(Splitter.java:104)