Skip to content
Kafka Is Fun

Lesson 6 of 6

Producers & Consumers

1 min read

Overview

Producers write records to topics. With a key, the partition is chosen from a hash of the key; without one, the default partitioner sticks to a partition until about batch.size bytes have been produced to it, then switches. The acks setting controls durability: acks=0 means the producer does not wait for any acknowledgement, acks=1 means the leader responds after writing the record to its local log, and acks=all means the leader waits for the full set of in-sync replicas to acknowledge. Consumers track their own position, an offset, in each partition they read. Within a consumer group, each partition is consumed by exactly one consumer at any given time.

Key configuration

Settingsproperties
acks=all — the strongest guarantee, and the default
enable.idempotence=true — default; retries do not write duplicate copies
auto.offset.reset — where to start when there is no committed offset: latest (default), earliest or none

Production tip

Check yourself

Within one consumer group, how many consumers read a given partition at the same time?

Sources

Checked against Kafka 4.2 documentation on Oct 2026. Draft: not yet reviewed by a Kafka specialist. Releases move on, so confirm against the current documentation before you act on a number.

Try it in the simulator

Guided scenarios for this module — the simulator opens with the exercise already running.

Prefer a picture? Open the live cluster in 3D and watch records move between producer, brokers and consumers.