OnException maximumRedeliveries被忽略

时间:2018-05-30 09:45:14

标签: apache-camel spring-camel

在以下路由中,当我们得到异常时,将忽略来自redeliveryPolicy的maximumRedeliveries clausule。我们得到:

交付失败(ExchangeId上为MessageId:ID-UW205584-58231-1527668174534-39-248:ID-UW205584-58231-1527668174534-39-24)。交货尝试时:0

交付失败(ExchangeId上为MessageId:ID-UW205584-58231-1527668174534-39-248:ID-UW205584-58231-1527668174534-39-24)。在交付尝试时:1

然后它仍然在无限循环中重复最后一次重试。任何的想法?非常感谢社区!

我们的路线如下:

<?xml version="1.0" encoding="ASCII"?>
<routes xmlns="http://camel.apache.org/schema/spring">
    <route handleFault="true">
        <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>

            <redeliveryPolicy maximumRedeliveries="2" redeliveryDelay="6000" maximumRedeliveryDelay="90000" 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>

1 个答案:

答案 0 :(得分:0)

因为你得到了一个无限循环,所以听起来消息标题CamelRedeliveryCounter每次被覆盖,因此它永远不会达到maximumRedeliveries的2。

发生错误的端点调用是否可能删除或重置邮件头?特别是CamelRedeliveryCounter