【问题标题】:Camel exchange failed without an exception骆驼交换无一例外失败
【发布时间】:2018-06-01 15:47:59
【问题描述】:

在从 Camel 2.1 升级到 2.17 和一些代码修改后,我们在 Camel 中的异常处理方面遇到了一些问题。我们从应用 A 向应用 B 发送消息。快乐的流程可以正常工作,但不快乐的流程不能。

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

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

我们从 Camel 得到的异常是:

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>

【问题讨论】:

    标签: apache-camel spring-camel


    【解决方案1】:

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

    XML 中的路由示例:

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

    【讨论】:

    • 谢谢。的确。我测试了它,但接下来发生的事情很奇怪......它进入一个永久循环,忽略了 maximumRedeliveries 子句:失败的传递(MessageId:ID-UW205584-58231-1527668174534-39-248 on ExchangeId:ID-UW205584-58231- 1527668174534-39-24)。传递尝试:0 (MessageId:ID-UW205584-58231-1527668174534-39-248 上的 ExchangeId:ID-UW205584-58231-1527668174534-39-24)传递失败。交付尝试:1 然后它保持在交付尝试:1 永久
    • 嗯,目前不知道这个。但是让社区在你的other, dedicated question 中关注它:-)
    猜你喜欢
    • 2022-01-11
    • 2017-01-03
    • 2014-04-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多