Bird
0
0

You want to process messages from multiple Kafka topics but ensure order is preserved per topic. How should you configure your consumer?

hard📝 Application Q8 of 15
Kafka - Consumers
You want to process messages from multiple Kafka topics but ensure order is preserved per topic. How should you configure your consumer?
ASubscribe to all topics and process messages partition-wise to keep order
BSubscribe to all topics and process messages as they arrive without order
CCreate one consumer per topic and process messages in parallel ignoring order
DUse a single topic for all messages to simplify ordering
Step-by-Step Solution
Solution:
  1. Step 1: Understand ordering in Kafka

    Order is guaranteed within partitions, so processing partition-wise preserves order.
  2. Step 2: Configure consumer subscription and processing

    Subscribe to multiple topics and handle messages partition-wise to maintain order per topic.
  3. Final Answer:

    Subscribe to all topics and process messages partition-wise to keep order -> Option A
  4. Quick Check:

    Partition-wise processing preserves order per topic [OK]
Quick Trick: Process messages partition-wise to keep order [OK]
Common Mistakes:
  • Ignoring partition order guarantees
  • Processing messages as they arrive unordered
  • Using one consumer per topic without order control

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes