Rebalancing is the process where Kafka redistributes partitions among consumers in a group when consumers join, leave, or fail. It ensures all partitions are assigned to active consumers.
Click to reveal answer
beginner
When does Kafka trigger a rebalance?
Kafka triggers a rebalance when a consumer joins or leaves the group, or when a consumer crashes. This helps keep partition assignments balanced.
Click to reveal answer
intermediate
What happens to message processing during a Kafka rebalance?
During rebalance, consumers stop fetching messages temporarily. This pause ensures partitions are reassigned safely but can cause a short delay in processing.
Click to reveal answer
intermediate
How can you minimize rebalance impact in Kafka?
You can minimize rebalance impact by tuning session timeouts, using static group membership, and handling partition assignments efficiently in your consumer code.
Click to reveal answer
advanced
What is static membership in Kafka rebalancing?
Static membership allows consumers to keep their identity across restarts, reducing unnecessary rebalances and improving stability during consumer restarts.
Click to reveal answer
What triggers a Kafka consumer group rebalance?
AA consumer joins or leaves the group
BA message is produced to a topic
CA consumer reads a message
DA topic is deleted
✗ Incorrect
Rebalance happens when consumers join or leave the group to redistribute partitions.
During rebalance, what happens to message consumption?
AConsumers continue reading without interruption
BConsumers pause fetching messages temporarily
CMessages are lost
DNew partitions are created
✗ Incorrect
Consumers pause fetching messages during rebalance to safely reassign partitions.
Which Kafka feature helps reduce unnecessary rebalances?