Bird
0
0

In a Kafka CQRS system, if the event store topic receives an event {"orderId": 5, "status": "shipped"}, what should the query side do?

medium📝 Predict Output Q5 of 15
Kafka - Event-Driven Architecture
In a Kafka CQRS system, if the event store topic receives an event {"orderId": 5, "status": "shipped"}, what should the query side do?
ASend a command to change the order status again
BUpdate the read model to reflect the new order status
CIgnore the event because queries don't handle events
DDelete the event from the topic
Step-by-Step Solution
Solution:
  1. Step 1: Understand event role in CQRS

    Events represent changes in system state, which the query side uses to update its read model.
  2. Step 2: Apply event to query side

    The query side updates its data to reflect the new order status 'shipped' for orderId 5.
  3. Final Answer:

    Update the read model to reflect the new order status -> Option B
  4. Quick Check:

    Query side updates read model from events [OK]
Quick Trick: Query side updates data from events, not commands [OK]
Common Mistakes:
MISTAKES
  • Confusing commands with events
  • Trying to send commands from query side
  • Ignoring events on query side

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes