davsclaus opened a new pull request, #29758:
URL: https://github.com/apache/camel/pull/29758

   Fixes [CAMEL-25589](https://issues.apache.org/jira/browse/CAMEL-25589)
   
   **Bug.** When the transacted `hazelcast-seda` consumer rolls back the 
transaction of a failed exchange (or of one marked rollback only, since 
CAMEL-25550), the message is back on the queue and the consumer polled again at 
once. `onErrorDelay` applied only to an exception from the poll or the 
transaction itself (the outer `catch`). A message that always fails was 
therefore taken, routed and rolled back in a tight loop.
   
   **Fix** (`HazelcastSedaConsumer`):
   - the existing `Tasks.backgroundTask` delay moved into `waitOnErrorDelay()`, 
used by the outer `catch` as before;
   - `onExchangeDone()` returns whether it rolled the transaction back, and the 
transacted path calls `waitOnErrorDelay()` after a rollback;
   - the non-transacted path is unchanged: nothing goes back on the queue there.
   
   The `onErrorDelay` description now says it applies after a rollback too 
(regenerated component JSON, catalog copy, endpoint DSL).
   
   **Test.** New `HazelcastSedaTransactedRollbackDelayTest`: a transacted 
endpoint with `onErrorDelay=3000` and a route that always fails, against a 
queue that keeps returning the rolled back message. The message must be 
delivered once, not again for 2 s, and again after the delay; the transaction 
is rolled back, never committed. It fails without the fix (the message is 
redelivered in a loop). All 28 `HazelcastSeda*` tests and the whole module (296 
tests) pass.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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

Reply via email to