Group Coordinator in Kafka
📖 Scenario: You are working with Apache Kafka, a system that helps many computers talk to each other by sending messages. In Kafka, a group coordinator is like a team leader who manages a group of computers (called consumers) that read messages together.Understanding how the group coordinator works helps keep the message reading organized and balanced.
🎯 Goal: Build a simple Kafka consumer group setup where you create a group coordinator to manage consumers reading messages from a topic.You will create the initial consumer group data, configure the group coordinator ID, implement the logic to assign partitions to consumers, and finally print the assignment result.
📋 What You'll Learn
Create a dictionary called
consumers with these exact entries: 'consumer1': [], 'consumer2': [], 'consumer3': []Create a variable called
group_coordinator_id and set it to 1Use a
for loop to assign partitions from partitions_list to consumers in a round-robin wayPrint the
consumers dictionary to show the final partition assignments💡 Why This Matters
🌍 Real World
Kafka uses group coordinators to manage consumer groups reading messages from topics, ensuring balanced load and fault tolerance.
💼 Career
Understanding group coordinators is important for roles like Kafka administrator, backend developer, or data engineer working with real-time data pipelines.
Progress0 / 4 steps