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

   ## Summary
   
   _Claude Code on behalf of davsclaus_
   
   Fixes the first bug reported in 
[CAMEL-23994](https://issues.apache.org/jira/browse/CAMEL-23994): the condition 
in `KafkaResumeAdapter.deserialize()` was inverted, causing all valid 
`topic/partition` keys to be silently discarded and invalid keys to trigger 
`ArrayIndexOutOfBoundsException`.
   
   **Changes:**
   - Fixed the inverted condition from `keyParts == null || keyParts.length != 
2` to `keyParts.length == 2` (the `null` check was also dead code since 
`String.split()` never returns `null`)
   - Fixed typo in warning message ("in invalid" → "an invalid")
   - Added `KafkaResumeAdapterTest` with tests for valid keys, multiple keys, 
invalid keys (no slash, too many parts), and invalid value types
   
   **Impact:** Consumers configured with a `resumeStrategy` never restored 
persisted offsets on restart — `resumeCache` stayed empty, and the consumer 
silently restarted from the group/`auto.offset.reset` position.
   
   **Bug present since:** CAMEL-18688 (commit `59046fe140ff`, Nov 2022).
   
   ## Test plan
   
   - [x] Added unit tests for `KafkaResumeAdapter.deserialize()` covering valid 
keys, invalid keys, and invalid values
   - [x] All tests pass (`mvn test -Dtest=KafkaResumeAdapterTest`)
   
   🤖 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