Hi
Redelivery is not disabled when maximumRedeliveries is set to 0. I experience
that one redelivery is always attempted.
The errorhandler looks like this.
<errorHandler xmlns="http://camel.apache.org/schema/spring"
id="failedMessagesErrorHandler"
type="DeadLetterChannel" deadLetterUri="jms:deadLetters"
useOriginalMessage="true">
<redeliveryPolicy maximumRedeliveries="0"/>
</errorHandler>
It seems like the last line could be the problem:
From RedeliveryPolicy.java:
/**
* Returns true if the policy decides that the message exchange should be
* redelivered.
*
* @param exchange the current exchange
* @param redeliveryCounter the current retry counter
* @param retryWhile an optional predicate to determine if we should
redeliver or not
* @return true to redeliver, false to stop
*/
public boolean shouldRedeliver(Exchange exchange, int redeliveryCounter,
Predicate retryWhile) {
// predicate is always used if provided
if (retryWhile != null) {
return retryWhile.matches(exchange);
}
if (getMaximumRedeliveries() < 0) {
// retry forever if negative value
return true;
}
// redeliver until we hit the max
return redeliveryCounter <= getMaximumRedeliveries();
}
Am I doing something wrong ? Are there some properties that I have to set ?
-- camel version: 2.7.1
--
Morten Holm
Developer
Voice: +45 31 18 91 08
Skype: morten.holm
http://tradeshift.com - INVOICING HAS NEVER BEEN EASIER