oscerd commented on code in PR #27883: URL: https://github.com/apache/camel/pull/27883#discussion_r4281928583
########## docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc: ########## @@ -138,6 +138,15 @@ A message that the route marks rollback only every time was removed before, and Handle such a message in the route instead, for example by moving it aside, rather than marking it rollback only every time. +=== camel-sql, camel-mybatis, camel-jooq - an exchange marked rollback only last is not consumed either + +The SQL, MyBatis and jOOQ consumers already left a message unconsumed when the route marked the exchange rollback +only with `markRollbackOnly()` (the SQL and MyBatis consumers also run their `onConsumeFailed` statement for it). They +now leave it unconsumed when the route marks it rollback only last with `markRollbackOnlyLast()` too, as the JPA and +Hazelcast SEDA consumers do. `markRollbackOnlyLast()` reaches the consumer only when no `transacted()` EIP has +consumed the flag, so the consumer's own transaction is the last one and is rolled back as well: a transacted +consumer breaks out of its batch, and a non-transacted one leaves the row so the next poll consumes it again. Review Comment: Fixed in `0467f0a647bf`. I verified camel-mybatis has no `onConsumeFailed` (only camel-sql does) and camel-jooq has no transacted mode, and the entry now says exactly what each consumer does: the SQL consumer runs `onConsumeFailed` instead of `onConsume` (no statement when it isn't set), the MyBatis consumer does not run `onConsume`, and the jOOQ consumer does not delete the entity; and only the SQL and MyBatis consumers break out of the batch with `transacted=true`. I corrected the same wording in the PR description, and added a transacted rollback-only-last test to `MyBatisOnConsumeFailedTest`. Thanks for catching it. _Claude Code on behalf of oscerd_ -- 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]
