
12/18/2019 · Justine Olshan
What this post added
Introduces the sticky partitioning strategy for Apache Kafka producers, available from version 2.4. This strategy optimizes batching for records with null keys by selecting a single partition for a batch before randomly choosing a new one. It includes performance benchmarks demonstrating reduced latency and CPU usage compared to the previous default partitioning strategy, especially with increased partitions and null keys. The post also details the `onNewBatch` interface addition to the partitioner for implementing sticky partitioning and discusses its performance with keyed messages and varying `linger.ms` settings.