gnodet-bot commented on code in PR #29380:
URL: https://github.com/apache/camel/pull/29380#discussion_r4501158750
##########
core/camel-core-processor/src/main/java/org/apache/camel/processor/errorhandler/RedeliveryErrorHandler.java:
##########
@@ -1676,6 +1676,9 @@ protected void prepareExchangeForContinue(Exchange
exchange, boolean isDeadLette
exchange.getIn().removeHeader(Exchange.REDELIVERED);
exchange.getIn().removeHeader(Exchange.REDELIVERY_COUNTER);
exchange.getIn().removeHeader(Exchange.REDELIVERY_MAX_COUNTER);
+ // also the counter of the exchange, as when the failure is
handled: a continued exchange is not redelivered
Review Comment:
The comment says *"as when the failure is handled"* but
`prepareExchangeForContinue` is only ever called from
`prepareExchangeAfterFailure`, which is called after the exhausted-handler path
that already resets the counter to `-1` (lines 748 and 1897). So this reset is
defensive/idempotent — the method will work correctly regardless. The comment
is slightly misleading in implying this is the primary reset point. Consider
clarifying:
```suggestion
// also reset the exchange counter; a continued exchange is not
redelivered
exchange.getExchangeExtension().setRedeliveryCounter(-1);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]