CCDAK · Question #162
You are working on an Orders microservice that is publishing messages to an Orders topic. It is a business requirement that the Orders for a given customer are processed sequentially. The Orders…
The correct answer is B. Enable producer Idempotence. Ensure the message key is set to customer id, set max-in-flight. Setting the message key to the customer id ensures that all orders for a given customer go to the same partition and are processed sequentially. Enabling idempotence and keeping max-in-flight requests per connection to ≤5 ensures ordering and exactly-once delivery, while not…
Question
You are working on an Orders microservice that is publishing messages to an Orders topic. It is a business requirement that the Orders for a given customer are processed sequentially. The Orders topic is partitioned for scalability. You need to ensure the business requirements are met during application development. Which action should you take?
Options
- AEnable producer Idempotence. Ensure the message key is set to current timestamp, set
- BEnable producer Idempotence. Ensure the message key is set to customer id, set max-in-flight
- CEnable producer Idempotence. Ensure the message key is set to producer id, set max-in-flight
- DEnable producer Idempotence. Ensure the message key is set to current timestamp, set linger.ms
How the community answered
(40 responses)- A8% (3)
- B48% (19)
- C33% (13)
- D13% (5)
Explanation
Setting the message key to the customer id ensures that all orders for a given customer go to the same partition and are processed sequentially. Enabling idempotence and keeping max-in-flight requests per connection to ≤5 ensures ordering and exactly-once delivery, while not changing the number of partitions maintains key-to-partition mapping.
Topics
Community Discussion
No community discussion yet for this question.