Bird
0
0

Given a Saga with three steps: A, B, and C, where each step publishes an event to Kafka, what happens if step B fails after step A succeeds?

medium📝 Predict Output Q13 of 15
Kafka - Event-Driven Architecture
Given a Saga with three steps: A, B, and C, where each step publishes an event to Kafka, what happens if step B fails after step A succeeds?
AStep A is compensated by sending a rollback event
BStep C executes anyway to complete the transaction
CThe entire Saga is aborted without compensation
DStep B retries indefinitely without affecting others
Step-by-Step Solution
Solution:
  1. Step 1: Understand failure handling in Saga

    If a step fails, previous successful steps must be undone using compensating actions.
  2. Step 2: Apply to the scenario

    Since step B failed after A succeeded, step A must be compensated by sending a rollback event.
  3. Final Answer:

    Step A is compensated by sending a rollback event -> Option A
  4. Quick Check:

    Failure in step B triggers compensation for step A [OK]
Quick Trick: Failed step triggers compensation for prior steps [OK]
Common Mistakes:
MISTAKES
  • Assuming next steps run despite failure
  • Thinking Saga aborts without compensation
  • Believing retries never stop

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes