Bird
0
0

Given a Kafka consumer configured with auto-commit disabled, what will happen if the consumer crashes before committing offsets?

medium📝 Predict Output Q4 of 15
Kafka - Consumers
Given a Kafka consumer configured with auto-commit disabled, what will happen if the consumer crashes before committing offsets?
AThe consumer will automatically commit offsets on restart
BThe consumer will lose all messages and start from the beginning
CThe consumer will resume from the last committed offset on restart
DThe consumer will skip uncommitted messages
Step-by-Step Solution
Solution:
  1. Step 1: Understand offset commit behavior with auto-commit disabled

    When auto-commit is disabled, offsets are only saved when the consumer explicitly commits them.
  2. Step 2: Analyze crash impact before committing offsets

    If the consumer crashes before committing, on restart it resumes from the last committed offset, reprocessing uncommitted messages.
  3. Final Answer:

    The consumer will resume from the last committed offset on restart -> Option C
  4. Quick Check:

    Auto-commit disabled crash = resume from last commit [OK]
Quick Trick: Without commit, consumer reprocesses messages after crash [OK]
Common Mistakes:
  • Assuming consumer starts from beginning always
  • Thinking offsets auto-commit on restart
  • Believing uncommitted messages are skipped

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes