gnodet-bot commented on code in PR #27883:
URL: https://github.com/apache/camel/pull/27883#discussion_r4282020843
##########
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:
Missing `testTransactedRollbackOnlyLastExchangeBreaksOutOfBatch` — the
transacted+rollback-only-last path is not tested in
`SqlConsumerRollbackOnlyTest`.
`MyBatisOnConsumeFailedTest` added this test in the same PR. The SQL
transacted break-out (`if (isTransacted() && failed)`) now includes
`isRollbackOnlyLast()`, but no SQL test exercises that branch. Add a test
analogous to `testTransactedRollbackOnlyExchangeBreaksOutOfBatch` that uses
`markRollbackOnlyLast()` on the `transacted` route.
--
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]