conduktor.io ↗

enable.idempotence — Kafka Producer Configuration

When set to 'true', the producer will ensure that exactly one copy of each message is written in the stream. If 'false', producer retries due to broker failures, etc.

Description

When set to 'true', the producer will ensure that exactly one copy of each message is written in the stream. If 'false', producer retries due to broker failures, etc., may write duplicates of the retried message in the stream. Note that enabling idempotence requires max.in.flight.requests.per.connection to be less than or equal to 5 (with message ordering preserved for any allowable value), retries to be greater than 0, and acks must be 'all'.

Default Values by Kafka Version

Kafka VersionDefault Value
0.11.0false
1.0false
1.1false
2.0false
2.1false
2.2false
2.3false
2.4false
2.5false
2.6false
2.7false
2.8false
3.0true
3.1true
3.2true
3.3true
3.4true
3.5true
3.6true
3.7true
3.8true
3.9true
4.0true
4.1true
4.2true

Tuning Recommendation

ProfileRecommendedWhy
producer / throughputtrueKeep idempotence enabled (default since 3.0): it adds zero throughput cost while preventing duplicate records on retries, and it is required for exactly-once semantics; disabling it only saves overhead if acks=0 is set.
producer / latencyfalseDisabling idempotence is required when acks=1 is set; it also removes the PID assignment handshake at startup and the sequence-number tracking overhead per batch, shaving a few microseconds per ProduceRequest on the hot path.
producer / durabilitytrueIdempotent producer assigns a monotonically increasing sequence number per partition per PID; the broker deduplicates any retry of the same batch within the same producer epoch, guaranteeing exactly-once per partition even when the network causes a resend. Default since Kafka 3.0.

Related Configs

acks · retries · max.in.flight.requests.per.connection · transactional.id

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