问题描述
在以下路由中,当我们得到异常时,将忽略来自redeliveryPolicy的maximumRedeliveries子句.我们得到:
In the following route, the maximumRedeliveries clausule from redeliveryPolicy is ignored when we get an exception. We get:
(ExchangeId:ID-UW205584-58231-1527668174534-39-24上的(MessageId:ID-UW205584-58231-1527668174534-39-248)传递失败.尝试送货时:0
(ExchangeId:ID-UW205584-58231-1527668174534-39-24上的(MessageId:ID-UW205584-58231-1527668174534-39-248)传递失败.尝试投放时: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
每次都被覆盖,因此它永远不会达到2的maximumRedeliveries
.
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被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!