Bird
0
0

Which of the following is the correct Kafka message key usage in a Saga pattern?

easy📝 Syntax Q3 of 15
Kafka - Event-Driven Architecture
Which of the following is the correct Kafka message key usage in a Saga pattern?
AUse a unique transaction ID as the message key to ensure ordering.
BUse a random UUID for each message key to maximize parallelism.
CUse the service name as the message key to group messages.
DDo not use any key to allow Kafka to distribute messages randomly.
Step-by-Step Solution
Solution:
  1. Step 1: Importance of message key in Kafka

    Message keys determine partitioning and ordering within partitions.
  2. Step 2: Using transaction ID as key

    Using a unique transaction ID as key ensures all messages for that transaction go to the same partition and maintain order.
  3. Final Answer:

    Use a unique transaction ID as the message key to ensure ordering. -> Option A
  4. Quick Check:

    Kafka message key = transaction ID for ordering [OK]
Quick Trick: Use transaction ID as key to keep messages ordered [OK]
Common Mistakes:
  • Using random keys breaks ordering
  • Using service name groups unrelated transactions
  • Not using keys causes random distribution

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes