0
0
Kafkadevops~5 mins

Auto-commit vs manual commit in Kafka - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What is auto-commit in Kafka consumer?
Auto-commit is when Kafka automatically saves the position of the last message read (offset) at regular intervals without programmer intervention.
Click to reveal answer
beginner
What does manual commit mean in Kafka consumer?
Manual commit means the programmer explicitly tells Kafka when to save the offset after processing messages, giving more control over message handling.
Click to reveal answer
intermediate
Why might you prefer manual commit over auto-commit?
Manual commit is preferred when you want to ensure messages are fully processed before saving the offset, avoiding message loss or duplication.
Click to reveal answer
intermediate
What is a risk of using auto-commit in Kafka?
Auto-commit can cause message loss or duplication if the consumer crashes after committing but before processing messages fully.
Click to reveal answer
beginner
How does Kafka track which messages a consumer has read?
Kafka tracks this using offsets, which are numbers marking the position of the last message read in a topic partition.
Click to reveal answer
What does auto-commit do in Kafka consumers?
ARequires manual saving of offsets
BAutomatically saves the offset at intervals
CDeletes messages after reading
DSends messages to another topic
Why use manual commit in Kafka?
ATo avoid using offsets
BTo speed up message consumption
CTo automatically delete messages
DTo control when offsets are saved after processing
What risk is associated with auto-commit?
AOffsets never saved
BSlower message processing
CMessage loss or duplication if crash happens after commit
DMessages get corrupted
Which Kafka feature tracks the last read message?
AOffset
BPartition
CTopic
DBroker
If you want to ensure no message is lost, which commit method is better?
AManual commit
BAuto-commit
CNo commit
DRandom commit
Explain the difference between auto-commit and manual commit in Kafka consumers.
Think about who controls when the offset is saved.
You got /4 concepts.
    Why might manual commit be safer than auto-commit when processing messages?
    Consider what happens if the consumer crashes.
    You got /3 concepts.