Kafka Consumer Lag Simulator
Simulate a Kafka consumer group with 6 partitions and compute the lag for each partition. A producer is writing 500 msg/s to the topic, and your consumer processes at varying speeds per partition. Detect partitions falling behind by more than 10,000 messages.
Constraints
- •Use kafka-python 2.0+
- •Simulate using in-memory data structures
- •Alert if any partition lag > 10,000
Expected Output
Partition 0: produced=5000, consumed=6000, lag=0 Partition 1: produced=5000, consumed=4800, lag=200 ... All partitions within acceptable lag range.
Related Challenges
Solution
1
Output
Run your code to see output here.Difficulty
Easy
Submissions
4,281
Acceptance
68%