OnException maximumRedeliveries 被忽略 [英] OnException maximumRedeliveries ignored

查看:21
本文介绍了OnException maximumRedeliveries 被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

In the following route, the maximumRedeliveries clausule from redeliveryPolicy is ignored when we get an exception. We get:

失败的传递(MessageId:ID-UW205584-58231-1527668174534-39-248 on ExchangeId:ID-UW205584-58231-1527668174534-39-24).交付尝试:0

失败的传递(MessageId:ID-UW205584-58231-1527668174534-39-248 on ExchangeId:ID-UW205584-58231-1527668174534-39-24).交付尝试:1

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

And then it remains in a infinity loop repeating the last retry. Any idea? Thank you very much community!

我们的路线如下所示:

<?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>

推荐答案

因为你得到一个无限循环,听起来消息头 CamelRedeliveryCounter 每次都被覆盖,因此它永远不会到达 maximumRedeliveries 为 2.

Because you get an infinite loop, it sounds like the message header CamelRedeliveryCounter gets overwritten every time and therefore it never reaches the maximumRedeliveries of 2.

对发生错误的端点的调用是否有可能删除或重置消息头?特别是CamelRedeliveryCounter?

Is it possible that the call to the endpoint where the error occurs deletes or resets message headers? Particularly CamelRedeliveryCounter?

这篇关于OnException maximumRedeliveries 被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆