davsclaus commented on PR #26812: URL: https://github.com/apache/camel/pull/26812#issuecomment-5811736712
Both findings addressed, and the first one is right — I checked it by printing the counters rather than reasoning about them: ``` ATTEMPT 1 redeliveryCounter=null maxRedeliveries=null -> throws IOException ATTEMPT 2 redeliveryCounter=1 maxRedeliveries=1 -> the IOException policy's redelivery; throws IllegalArgumentException ATTEMPT 3 redeliveryCounter=2 maxRedeliveries=2 -> the IllegalArgumentException policy, counter already 2 ``` So the count of 3 was right but the comment's attribution was not: only one of the two extra attempts belongs to the `IllegalArgumentException` policy, and its `maximumRedeliveries(2)` yields one further attempt because `2 <= 2` passes once and then `3 > 2` exhausts. The comment now says that, with the reason. **Upgrade guide** — the carry-over is documented, with the case that bites: an `onException(IOException.class)` allowing 5 redeliveries that fails 4 times before the exception changes leaves the new policy a counter of 4, so an `onException(IllegalArgumentException.class).maximumRedeliveries(2)` is already exhausted and the next failure goes to the dead letter channel. Also merged main in — the branch was 39 commits behind, which made the diff look as though it removed the Weighted Load Balancer section. That was staleness, not a change; both sections are present now. 345 tests pass across `OnException*`, `*ErrorHandler*` and `*Redeliver*` in camel-core. -- 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]
