A Kafka Producer is a client application that publishes events to a Kafka cluster. Master partitioning, durability, batching, and configuration to build production-grade data pipelines.
Unlike consumers, producers need no group coordination. They map messages to topic partitions and send directly to the partition leader.
When a key is provided, murmur2 hashing guarantees all messages with the same key always land on the same partition — critical for ordering.
Without a key, Kafka uses sticky partitioning (KIP-480): batches fill a single partition before switching, improving throughput.
Writes go to the partition leader. Replicas sync from the leader. A message is only "committed" — and readable — once all in-sync replicas acknowledge.
Producers batch messages to improve throughput. Compression applies to full batches — larger batches yield better compression ratios.
Core configurations apply across Java, C/C++, Python, Go, and .NET clients. Some settings have language-specific naming conventions.
Send messages with and without keys to see how Kafka assigns them to partitions. Messages with the same key always route to the same partition.
── solid: write path --- dashed: replication acks response flows back to producer
Click any configuration parameter to explore its values, trade-offs, and recommendations.
Adjust settings to see how they trade off throughput, latency, and message safety.