Search⌘ K

Partitions

Explore how Kafka distributes messages across partitions using keys or default round-robin methods. Understand the role of replicas during partition failures. Discover how to implement custom partitioners to balance load and manage specific routing logic for efficient data processing.

We'll cover the following...

When sending messages to Kafka topics, we can choose whether or not to specify a key. If we don’t specify a key (i.e. it is set to null), Kafka’s default mechanism takes over to assign a partition. The default partitioner directs the message to one of the available partitions in a round-robin fashion.

If the key is specified but the partitioner class isn’t, then the default partitioner is employed. It will generate a hash of the ...