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., may write duplicates of the retried message in the stream
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'.Idempotence is enabled by default if no conflicting configurations are set. If conflicting configurations are set and idempotence is not explicitly enabled, idempotence is disabled. If idempotence is explicitly enabled and conflicting configurations are set, a ConfigException is thrown.Type:booleanDefault:trueValid Values:Importance:low
Default Values by Kafka Version
| Component | Kafka version line | Documented default |
|---|---|---|
| Producer | 0.11.0 | false |
| Producer | 1.0 | false |
| Producer | 1.1 | false |
| Producer | 2.0 | false |
| Producer | 2.1 | false |
| Producer | 2.2 | false |
| Producer | 2.3 | false |
| Producer | 2.4 | false |
| Producer | 2.5 | false |
| Producer | 2.6 | false |
| Producer | 2.7 | false |
| Producer | 2.8 | false |
| Producer | 3.0 | true |
| Producer | 3.1 | true |
| Producer | 3.2 | true |
| Producer | 3.3 | true |
| Producer | 3.4 | true |
| Producer | 3.5 | true |
| Producer | 3.6 | true |
| Producer | 3.7 | true |
| Producer | 3.8 | true |
| Producer | 3.9 | true |
| Producer | 4.0 | true |
| Producer | 4.1 | true |
| Producer | 4.2 | true |
| Producer | 4.3 | true |
| Producer | 4.4 | true |
Tuning Recommendation
Workload-dependent proposals, not benchmarked defaults. Review the versioned Config Advisor before applying.
| Profile | Proposal | Rationale and tradeoff |
|---|---|---|
| producer / throughput | true | Deduplicates retried producer batches within the producer protocol and preserves ordering with compatible settings. It is not end-to-end exactly-once processing. Tradeoff: Requires acks=all, retries greater than zero and at most five in-flight requests in Java. Application retries across producer sessions can still duplicate business events. Reference · 2026-10-27 |
| producer / latency | true | Deduplicates retried producer batches within the producer protocol and preserves ordering with compatible settings. It is not end-to-end exactly-once processing. Tradeoff: Requires acks=all, retries greater than zero and at most five in-flight requests in Java. Application retries across producer sessions can still duplicate business events. Reference · 2026-10-27 |
| producer / durability | true | Deduplicates retried producer batches within the producer protocol and preserves ordering with compatible settings. It is not end-to-end exactly-once processing. Tradeoff: Requires acks=all, retries greater than zero and at most five in-flight requests in Java. Application retries across producer sessions can still duplicate business events. Reference · 2026-10-27 |
Related Configs
acks · retries · max.in.flight.requests.per.connection · transactional.id