Files
seaweedfs/weed/mq/kafka/protocol
chrislu c3dd0c566e 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.
2025-09-12 09:07:13 -07:00
..
2025-09-11 19:53:00 -07:00
2025-09-11 19:53:00 -07:00
2025-09-11 19:53:00 -07:00