Confluent
CCDAK · Question #167
You create a topic named 'stream-logs'. The topic has: - A replication factor of three - Four partitions - Messages that are plain logs without a key How will messages be distributed across partitions
The correct answer is B. Messages will be distributed round-robin among all the topic partitions.. When messages are produced without a key, the Kafka producer uses a round-robin algorithm to distribute messages evenly across all partitions of the topic.
Developing Kafka Producers
Question
You create a topic named 'stream-logs'. The topic has:
- A replication factor of three
- Four partitions
- Messages that are plain logs without a key
How will messages be distributed across partitions?
Options
- AThe first message will always be written to partition 0.
- BMessages will be distributed round-robin among all the topic partitions.
- CAll messages will be written to the same log segment.
- DMessages will be distributed among all the topic partitions with strict ordering.
How the community answered
(59 responses)- A2% (1)
- B90% (53)
- C3% (2)
- D5% (3)
Explanation
When messages are produced without a key, the Kafka producer uses a round-robin algorithm to distribute messages evenly across all partitions of the topic.
Topics
#partition assignment#round-robin#keyless messages
Community Discussion
No community discussion yet for this question.