nerdexam
Confluent

CCDAK · Question #79

You are receiving orders from different customer in an "orders" topic with multiple partitions. Each message has the customer name as the key. There is a special customer named ABC that generates a lo

The correct answer is B. Create a custom partitioner. A Custom Partitioner allows you to easily customise how the partition number gets computed from a source message.

Developing Kafka Producers

Question

You are receiving orders from different customer in an "orders" topic with multiple partitions. Each message has the customer name as the key. There is a special customer named ABC that generates a lot of orders and you would like to reserve a partition exclusively for ABC. The rest of the message should be distributed among other partitions. How can this be achieved?

Options

  • AAdd metadata to the producer record
  • BCreate a custom partitioner
  • CAll messages with the same key will go the same partition, but the same partition may have
  • DDefine a Kafka Broker routing rule

How the community answered

(37 responses)
  • A
    19% (7)
  • B
    70% (26)
  • C
    8% (3)
  • D
    3% (1)

Explanation

A Custom Partitioner allows you to easily customise how the partition number gets computed from a source message.

Topics

#custom partitioner#partition assignment#producer partitioner#message routing

Community Discussion

No community discussion yet for this question.

Full CCDAK Practice