Recall & Review
beginner
What is the main role of a Kafka Consumer?
A Kafka Consumer reads data from Kafka topics. It subscribes to topics and processes the messages sent by producers.
Click to reveal answer
beginner
What does 'subscribe()' method do in Kafka Consumer API?
The subscribe() method tells the consumer which topics to listen to. It allows the consumer to receive messages from those topics.
Click to reveal answer
beginner
Explain what 'poll()' method does in Kafka Consumer API.
The poll() method fetches records from the Kafka broker. It waits for new messages and returns them for processing.
Click to reveal answer
intermediate
Why is committing offsets important in Kafka Consumer?
Committing offsets tells Kafka which messages have been processed. This helps avoid processing the same message twice after a restart.
Click to reveal answer
intermediate
What is the difference between automatic and manual offset commit?
Automatic commit happens periodically without user control, while manual commit lets the user decide when to save the offset after processing messages.
Click to reveal answer
What method does a Kafka Consumer use to start receiving messages from a topic?
✗ Incorrect
The subscribe() method is used to tell the consumer which topics to listen to.
Which method fetches messages from Kafka for the consumer to process?
✗ Incorrect
poll() is the method that retrieves messages from Kafka.
Why do consumers commit offsets?
✗ Incorrect
Committing offsets marks messages as processed to avoid reprocessing.
What happens if a consumer does not commit offsets?
✗ Incorrect
Without committing offsets, the consumer may read the same messages again after restarting.
Which of these is a valid way to control offset commits?
✗ Incorrect
Manual commit lets the consumer decide when to save offsets.
Describe the basic steps a Kafka Consumer takes to read messages from a topic.
Think about how the consumer connects, gets data, and remembers progress.
You got /4 concepts.
Explain why offset management is important in Kafka Consumer API.
Consider what happens if the consumer restarts.
You got /4 concepts.