Recall & Review
beginner
What is the purpose of the consumer poll loop in Kafka?
The consumer poll loop continuously fetches messages from Kafka topics, allowing the consumer to process new data as it arrives.
Click to reveal answer
beginner
In Kafka's consumer poll loop, what does the poll() method do?
The poll() method requests records from Kafka brokers and returns any available messages for the consumer to process.
Click to reveal answer
intermediate
Why should the consumer poll loop run continuously without long blocking operations?
Because Kafka expects consumers to poll regularly to maintain their group membership and avoid rebalancing or session timeouts.
Click to reveal answer
intermediate
What happens if a Kafka consumer does not call poll() within the session timeout?
The consumer is considered dead, triggering a rebalance where partitions are reassigned to other consumers.
Click to reveal answer
intermediate
How can you safely commit offsets in a Kafka consumer poll loop?
You can commit offsets synchronously or asynchronously after processing messages to track progress and avoid duplicate processing.
Click to reveal answer
What is the main role of the poll() method in a Kafka consumer loop?
✗ Incorrect
The poll() method fetches messages from Kafka brokers for the consumer to process.
What happens if a Kafka consumer stops calling poll() for longer than the session timeout?
✗ Incorrect
Kafka considers the consumer dead and triggers a rebalance to assign partitions to other consumers.
Which of these is a best practice inside a Kafka consumer poll loop?
✗ Incorrect
The consumer should call poll() regularly to maintain group membership and receive messages.
When should a Kafka consumer commit offsets in the poll loop?
✗ Incorrect
Committing offsets after processing ensures the consumer does not reprocess messages after restart.
What does a rebalance mean in the context of Kafka consumer poll loops?
✗ Incorrect
Rebalance redistributes partitions among consumers when group membership changes or a consumer fails.
Explain how the Kafka consumer poll loop works and why it is important.
Think about how the consumer stays connected and gets new data.
You got /5 concepts.
Describe what happens if a Kafka consumer does not call poll() often enough.
Consider the impact on the consumer group and message processing.
You got /4 concepts.