Browse Source
Fix OffsetCommit/OffsetFetch hardcoded parsing for real clients
Fix OffsetCommit/OffsetFetch hardcoded parsing for real clients
CRITICAL FIX: Implement proper OffsetCommit/OffsetFetch request parsing ## Issues Fixed: - OffsetCommit was returning hardcoded 'test-topic' with partition 0 - OffsetFetch was ignoring actual topics/partitions in requests - Consumer groups could not commit/fetch real offsets - Parsing logic was completely stubbed out ## OffsetCommit Implementation: - Parse RetentionTime (8 bytes, -1 for broker default) - Parse Topics array with actual topic names - Parse Partitions array with: - Partition index (4 bytes) - Committed offset (8 bytes) - Leader epoch (4 bytes) - Metadata (nullable string) - Added comprehensive debug logging ## OffsetFetch Implementation: - Parse Topics array with actual topic names - Parse Partitions array (empty = fetch all partitions) - Parse RequireStable flag for transactional consistency - Handle 'fetch all partitions' case (partitionsCount = 0) - Added comprehensive debug logging ## Protocol Compliance: - Follows Kafka protocol specification for OffsetCommit/OffsetFetch - Proper handling of nullable strings and arrays - Correct byte order parsing (BigEndian) - Robust error handling for malformed requests ## Testing: - Compilation successful - Debug logging will show actual parsed values - Should enable real consumer group offset management This fix resolves the second most critical compatibility issue preventing real Kafka clients from managing consumer group offsets.pull/7231/head
1 changed files with 165 additions and 32 deletions
Write
Preview
Loading…
Cancel
Save
Reference in new issue