allthingssecurity commented on PR #30132: URL: https://github.com/apache/camel/pull/30132#issuecomment-6904650428
Thanks for the second look. Pushed 18215af. **Finding 1 (batching processor):** I checked it and the batching path is not affected, so I left `KafkaRecordBatchingProcessor` as it is. Its break calls the no-argument `commitManager.commit()`, and that call never reaches Kafka when `batching=true`: - `KafkaConfiguration.isAutoCommitEnable()` returns `offsetRepository == null && !batching && autoCommitEnable`, so it is always false for a batching consumer, whatever `autoCommitEnable` is set to. - `SyncCommitManager.commit()` only calls `consumer.commitSync()` when `isAutoCommitEnable()` is true, and `AsyncCommitManager.commit()` the same for `commitAsync()`. `NoopCommitManager.commit()` and `CommitToOffsetManager.commit()` do nothing. So there is no `commitSync` in the batching break that can time out, and no `KafkaException` can leave `processException` to reach `startPolling`. To be sure I ran a throwaway copy of `KafkaConsumerBreakOnFirstErrorCommitTimeoutTest` with `batching=true&maxPollRecords=5` (manual sync commits, `autoCommitEnable` true and false, `pollOnError` `ERROR_HANDLER`, `DISCARD`, `RETRY`, `RECONNECT`), counting the calls of `commitSync()`: zero calls in the break, and the failed batch was polled again after the reconnect in every case. I did not keep it as a test since it pins a no-op. The PR description now says this more precisely. **Finding 2 (stale comment):** fixed. The comment above the commit of the break in `KafkaRecordStreamingProcessor` now says the commit can fail or time out, and the consumer still breaks out and polls again from the last committed offset. Comment-only change in code, so no new test. `KafkaConsumerBreakOnFirstErrorCommitTimeoutTest` passes (5 of 5) and the camel-kafka unit tests pass (349 run, 0 failures, 1 skipped). _Claude Code on behalf of allthingssecurity_ -- 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]
