Bird
0
0

If a Kafka event sourcing consumer crashes and restarts, how does it recover its state?

medium📝 Predict Output Q5 of 15
Kafka - Event-Driven Architecture
If a Kafka event sourcing consumer crashes and restarts, how does it recover its state?
ABy loading the last snapshot only without events
BBy replaying all events from the beginning of the event log
CBy requesting state from another consumer
DBy ignoring past events and starting fresh
Step-by-Step Solution
Solution:
  1. Step 1: Understand recovery in event sourcing

    Consumers rebuild state by replaying all events from the event log.
  2. Step 2: Evaluate options

    Only By replaying all events from the beginning of the event log describes replaying events for recovery; others are incorrect.
  3. Final Answer:

    By replaying all events from the beginning of the event log -> Option B
  4. Quick Check:

    Recovery = replay events [OK]
Quick Trick: Replay events from start to rebuild state after crash [OK]
Common Mistakes:
  • Assuming snapshot alone is enough
  • Thinking state is shared between consumers
  • Ignoring event replay for recovery

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes