nerdexam
Confluent

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…

Developing Kafka Producers

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)
  • A
    8% (3)
  • B
    48% (19)
  • C
    33% (13)
  • D
    13% (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

#idempotence#message keys#partition ordering#max-in-flight requests

Community Discussion

No community discussion yet for this question.

Full CCDAK Practice