conduktor.io ↗

partitioner.class — Kafka Producer Configuration

Determines which partition to send a record to when records are produced. Available options are:If not set, the default partitioning logic is used

Description

Determines which partition to send a record to when records are produced. Available options are:If not set, the default partitioning logic is used. This strategy send records to a partition until at least batch.size bytes is produced to the partition. It works with the strategy:If no partition is specified but a key is present, choose a partition based on a hash of the key.If no partition or key is present, choose the sticky partition that changes when at least batch.size bytes are produced to the partition.If client.rack is specified and partitioner.rack.aware=true, the sticky partition is chosen from partitions with the leader broker in the same rack, if at least one is available. If none are available, it falls back on selecting from all available partitions.org.apache.kafka.clients.producer.RoundRobinPartitioner: A partitioning strategy where each record in a series of consecutive records is sent to a different partition, regardless of whether the 'key' is provided or not, until partitions run out and the process starts over again. Note: There's a known issue that will cause uneven distribution when a new batch is created. See KAFKA-9965 for more detail.Implementing the org.apache.kafka.clients.producer.Partitioner interface allows you to plug in a custom partitioner.Type:classDefault:nullValid Values:Importance:medium

Default Values by Kafka Version

ComponentKafka version lineDocumented default
Producer0.7kafka.producer.DefaultPartitioner<T> - uses the partitioning strategy hash(key)%num_partitions. If key is null, then it picks a random partition.
Producer0.8.0kafka.producer.DefaultPartitioner
Producer0.8.1kafka.producer.DefaultPartitioner
Producer0.8.2kafka.producer.DefaultPartitioner
Producer0.9.0class org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer0.10.0class org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer0.10.1class org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer0.10.2org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer0.11.0org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer1.0org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer1.1org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer2.0org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer2.1org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer2.2org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer2.3org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer2.4org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer2.5org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer2.6org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer2.7org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer2.8org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer3.0org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer3.1org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer3.2org.apache.kafka.clients.producer.internals.DefaultPartitioner
Producer3.3null
Producer3.4null
Producer3.5null
Producer3.6null
Producer3.7null
Producer3.8null
Producer3.9null
Producer4.0null
Producer4.1null
Producer4.2null
Producer4.3null
Producer4.4null

Related Configs

partitioner.adaptive.partitioning.enable · partitioner.ignore.keys

Manage Kafka configs across all your clusters with Conduktor Console — view, compare, and update configurations in one place.