Bird
Raised Fist0

In a Kafka consumer application, you observe that offsets are committed but messages are still reprocessed after restart. Which is the most likely cause?

medium📝 Debug Q7 of Q15
Kafka - Message Delivery Semantics
In a Kafka consumer application, you observe that offsets are committed but messages are still reprocessed after restart. Which is the most likely cause?
AAuto commit is enabled with a very high commit interval.
BKafka broker is down during commit.
CConsumer group ID is changed between restarts.
DOffsets are committed before message processing completes.
Step-by-Step Solution
Solution:
  1. Step 1: Analyze commit timing

    If offsets commit before processing finishes, consumer may commit offset of unprocessed messages.
  2. Step 2: Effect on restart

    On restart, consumer resumes from committed offset, reprocessing messages that were not fully processed.
  3. Final Answer:

    Offsets are committed before message processing completes. -> Option D
  4. Quick Check:

    Commit after processing to avoid duplicates [OK]
Quick Trick: Commit offsets only after processing messages [OK]
Common Mistakes:
MISTAKES
  • Assuming group ID change causes reprocessing
  • Blaming auto commit interval without checking processing order
  • Ignoring broker availability impact

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes