From the course: Complete Guide to Apache Kafka for Beginners
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Producer default partitioner and sticky partitioner - Kafka Tutorial
From the course: Complete Guide to Apache Kafka for Beginners
Producer default partitioner and sticky partitioner
Okay. So let's go over one last thing, which is the default partitioner for your producer. So when your key is not null, then your data is going to go through a partitioner logic which decides how a record gets assigned to a partition. And this process is called key hashing, which is the process of determining the mapping of a key to a partition. And in the default Kafka partitioner the key are hashed using the murmur2 algorithm and this is the formula. And if we look at this formula, we can see that the same key goes to the same partition, because the murmur algorithm, it's predictable and therefore the same key goes to the same partition, because the formula has the exact same inputs and the exact same formula. But if we look at the formula, we look at the fact that if you look at num partitions, which is the right hand side part of this formula, and we increase it because we add partitions into our topic, then this entire formula is affected. And therefore once you add partitions…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
(Locked)
Wikimedia producer project setup6m 25s
-
(Locked)
Wikimedia producer implementation11m 54s
-
(Locked)
Wikimedia producer run2m 40s
-
Wikimedia producer: Producer config intros45s
-
(Locked)
Producer acknowledgments deep dive8m 48s
-
(Locked)
Producer retries3m 3s
-
(Locked)
Idempotent producer2m 52s
-
(Locked)
Safe Kafka producer settings1m 59s
-
(Locked)
Wikimedia producer safe producer implementation4m 3s
-
(Locked)
Kafka message compression4m 47s
-
(Locked)
linger.ms and batch.size producer settings3m 23s
-
(Locked)
Wikimedia producer high-throughput implementation3m 16s
-
(Locked)
Producer default partitioner and sticky partitioner4m 18s
-
(Locked)
[Advanced] max.block.ms and buffer.memory2m 39s
-
(Locked)
-
-
-
-
-
-