davsclaus opened a new pull request, #24687:
URL: https://github.com/apache/camel/pull/24687

   ## Summary
   
   _Claude Code on behalf of davsclaus_
   
   Fixes the second bug reported in 
[CAMEL-23994](https://issues.apache.org/jira/browse/CAMEL-23994): when a 
poll-loop exception was caught with `pollOnError=DISCARD` or `ERROR_HANDLER`, 
`SeekUtil.seekToNextOffset` was called with a hardcoded offset of -1 (lost 
during refactoring in CAMEL-16064), causing it to seek `position(tp) + 1` on 
ALL assigned partitions — silently dropping one unread message per partition.
   
   **Before:** Any exception during polling → seek position+1 on every 
partition → silent message loss on all partitions
   **After:**
   - `RecordDeserializationException` (poison message) → seek only the affected 
partition to `offset+1`
   - Other exceptions (transient Kafka errors, commit failures) → no position 
advancement since the error may not be record-related
   
   **Changes:**
   - Rewrote `SeekUtil.seekToNextOffset` to accept the `Exception` and use 
`RecordDeserializationException.topicPartition()` / `offset()` for targeted 
seeking
   - Updated `DiscardErrorStrategy` and `BridgeErrorStrategy` to pass the 
exception
   - The `PollExceptionStrategy.handle(long, Exception)` public API is unchanged
   
   **Note:** The `partitionLastOffset` parameter in 
`PollExceptionStrategy.handle()` has been effectively dead since the 
CAMEL-16064 refactoring (always -1). The strategies now use the exception for 
seeking instead.
   
   ## Test plan
   
   - [x] All 141 unit tests pass
   - [ ] CI integration tests will validate poll error handling
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   Co-Authored-By: Claude Opus 4.6 <[email protected]>


-- 
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]

Reply via email to