oscerd commented on code in PR #27883:
URL: https://github.com/apache/camel/pull/27883#discussion_r4282099840
##########
components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlConsumerRollbackOnlyTest.java:
##########
@@ -82,6 +82,16 @@ void
testRollbackOnlyExchangeWithoutOnConsumeFailedIsNotConsumed() throws Except
"without onConsumeFailed, the AMQ row, whose exchange was
marked rollback only, must not get onConsume");
}
+ @Test
+ void testRollbackOnlyLastExchangeIsNotConsumed() throws Exception {
+ // CAMEL-25588: an exchange marked rollback only last must be treated
like rollback only - no onConsume
+ SqlConsumer consumer = (SqlConsumer)
context.getRoute("on-consume-only-last").getConsumer();
+ assertEquals(3, consumer.poll());
+
+ assertEquals(List.of("LAST", "ASF", "LAST"), licenses(),
+ "the AMQ row, whose exchange was marked rollback only last,
must not get onConsume");
+ }
Review Comment:
Added in `447697427682`:
`SqlConsumerRollbackOnlyTest.testTransactedRollbackOnlyLastExchangeBreaksOutOfBatch`
— a `transacted=true` route marks the AMQ row `markRollbackOnlyLast()`, and
the test asserts the poll breaks out of the batch with a
`RollbackExchangeException` (wrapped in `RuntimeCamelException`) and that the
rollback-only-last row and the rows after it are not consumed. It mirrors the
existing transacted rollback-only test and the MyBatis one. (jOOQ has no
transacted mode, so there is no equivalent there.)
_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]