骆驼交换无一例外地失败了



从 Camel 2.1 升级到 2.17 并进行一些代码修改后,我们在 Camel 中的异常处理中遇到了一些问题。我们将消息从应用 A 发送到应用 B。快乐的流动工作正常,但不快乐的流动则不然。

我们发送消息以引起异常,但在onexception块中未正确处理。

实际上,我们看到以下跟踪日志:ProcessTaskEx - message received,但我没有看到:ProcessTaskEx - exception

我们从骆驼那里得到的例外是:

camel exchange failed without an exception: <SOAP-ENV:Fault xmlns:SOAP-ENV>

我们的路线是这样的,知道问题可能是什么吗?非常感谢您的时间社区!:)

<?xml version="1.0" encoding="ASCII"?>
<routes xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="switchyard://ProcessTaskEx"/>
<log message="ProcessTaskEx - message received: ${body}" loggingLevel="DEBUG" logName="WebServiceQueues" />
<to uri="switchyard://RequestCapacity"/>
<onException>
<exception>java.lang.Exception</exception>
<exception>webservicequeues.utilities.WebServiceQueueException</exception>
<log message="ProcessTaskEx - exception" loggingLevel="DEBUG" logName="WebServiceQueues" />
<redeliveryPolicy maximumRedeliveries="2" redeliveryDelay="60000" maximumRedeliveryDelay="900000" retriesExhaustedLogLevel="INFO" retryAttemptedLogLevel="INFO"/>
<handled>
<constant>true</constant>
</handled>
<log message="Failed after Retry.Sending ProcessTask Request to Error Queue" loggingLevel="ERROR" logName="WebServiceQueues" />
<to uri="switchyard://ErrorProcessTaskExQueue"/>
</onException>
</route>
</routes>

据我所知,默认情况下不会处理故障。要启用此功能,必须设置一个属性:handleFault="true"。它可以为整个 Camel 上下文或单个路线设置。

XML 中的路由示例:

<route handleFault="true">
...
</route

最新更新