Files
seaweedfs/weed/mq/kafka/protocol
chrislu 7149b723ec Phase 4: Implement consumer group protocol metadata parsing
Consumer Group Protocol Metadata completed:

## Core Enhancements
- **ClientHost extraction**: Real client IP/host instead of hardcoded 'unknown'
  - ExtractClientHost() extracts IP from connection context
  - Populates GroupMember.ClientHost with actual remote address
- **Enhanced protocol metadata parsing**: Robust parsing with error handling
  - ParseConsumerProtocolMetadata() with validation and graceful fallbacks
  - Handles malformed metadata, oversized fields, and edge cases
- **Improved assignment strategy selection**: Priority-based protocol selection
  - SelectBestProtocol() prefers sticky > roundrobin > range
  - Considers both client capabilities and existing group protocols

## Implementation Details
- **Connection Context**: Added ConnectionContext to Handler for client info
- **Metadata Analysis**: AnalyzeProtocolMetadata() for detailed debugging
- **Enhanced Subscription Extraction**: ExtractTopicsFromMetadata() with fallbacks
- **Validation**: SanitizeConsumerGroupID() prevents malformed group IDs
- **Graceful Error Handling**: Invalid metadata handled without failures

## New Files
- : Core metadata parsing and client context logic
- : Comprehensive test suite (17 test cases)

## Integration
- **JoinGroup enhancement**: Uses real client host and robust metadata parsing
- **Backward compatibility**: Legacy methods maintained for compatibility
- **Debug improvements**: Enhanced logging shows parsed protocol details

## Testing & Verification
- **17 comprehensive tests**: Protocol parsing, client host extraction, strategy selection
- **Edge case coverage**: Empty metadata, malformed data, oversized fields
- **E2E compatibility**: Sarama tests pass, no regressions
- **Performance validation**: Benchmark tests for parsing operations

Ready for Phase 5: Multi-batch Fetch concatenation support
2025-09-13 14:01:28 -07:00
..
2025-09-13 13:03:51 -07:00
2025-09-13 08:47:46 -07:00
2025-09-13 09:06:02 -07:00
2025-09-13 13:03:51 -07:00
2025-09-13 13:03:51 -07:00
2025-09-13 13:03:51 -07:00
2025-09-13 10:23:14 -07:00
2025-09-13 08:06:36 -07:00
2025-09-13 08:06:36 -07:00
2025-09-13 11:06:29 -07:00
2025-09-11 19:53:00 -07:00
2025-09-13 08:06:36 -07:00