davsclaus commented on code in PR #27883: URL: https://github.com/apache/camel/pull/27883#discussion_r4281857927
########## 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: camel-mybatis has no `onConsumeFailed` (only camel-sql has it), and camel-jooq has no transacted mode. Suggest saying exactly what each consumer now does: ```suggestion The SQL, MyBatis and jOOQ consumers now treat an exchange that the route marks with `markRollbackOnlyLast()` the same as one marked with `markRollbackOnly()`, as the JPA and Hazelcast SEDA consumers do. Before, it was treated as a success and the row was consumed. Now the SQL consumer runs `onConsumeFailed` instead of `onConsume` (no statement when `onConsumeFailed` is not set), the MyBatis consumer does not run `onConsume`, the jOOQ consumer does not delete the entity, and with `transacted=true` the SQL and MyBatis consumers break out of the batch. `markRollbackOnlyLast()` reaches the consumer only when no `transacted()` EIP in the route has consumed the flag, so the consumer's own transaction is the last one. ``` -- 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]
