retries — Kafka Producer Configuration
Number of times to retry a request that fails with a transient error. Setting a value greater than zero will cause the client to resend any record whose send fails with a potentially transient error
Description
Number of times to retry a request that fails with a transient error. Setting a value greater than zero will cause the client to resend any record whose send fails with a potentially transient error. Requests will be retried this many times until they succeed, fail with a non-transient error, or the delivery.timeout.ms expires. Note that this automatic retry will simply resend the same record upon receiving the error. Setting a value of zero will disable this automatic retry behaviour, so that the transient errors will be propagated to the application to be handled. Users should generally prefer to leave this config unset and instead use delivery.timeout.ms to control retry behavior.Enabling idempotence requires this config value to be greater than 0. If conflicting configurations are set and idempotence is not explicitly enabled, idempotence is disabled.Allowing retries while setting enable.idempotence to false and max.in.flight.requests.per.connection to greater than 1 will potentially change the ordering of records because if two batches are sent to a single partition, and the first fails and is retried but the second succeeds, then the records in the second batch may appear first.Type:intDefault:2147483647Valid Values:[0,...,2147483647]Importance:high
Default Values by Kafka Version
| Component | Kafka version line | Documented default |
|---|---|---|
| Producer | 0.8.1 | 0 |
| Producer | 0.8.2 | 0 |
| Producer | 0.9.0 | 0 |
| Producer | 0.10.0 | 0 |
| Producer | 0.10.1 | 0 |
| Producer | 0.10.2 | 0 |
| Producer | 0.11.0 | 0 |
| Producer | 1.0 | 0 |
| Producer | 1.1 | 0 |
| Producer | 2.0 | 0 |
| Producer | 2.1 | 2147483647 |
| Producer | 2.2 | 2147483647 |
| Producer | 2.3 | 2147483647 |
| Producer | 2.4 | 2147483647 |
| Producer | 2.5 | 2147483647 |
| Producer | 2.6 | 2147483647 |
| Producer | 2.7 | 2147483647 |
| Producer | 2.8 | 2147483647 |
| Producer | 3.0 | 2147483647 |
| Producer | 3.1 | 2147483647 |
| Producer | 3.2 | 2147483647 |
| Producer | 3.3 | 2147483647 |
| Producer | 3.4 | 2147483647 |
| Producer | 3.5 | 2147483647 |
| Producer | 3.6 | 2147483647 |
| Producer | 3.7 | 2147483647 |
| Producer | 3.8 | 2147483647 |
| Producer | 3.9 | 2147483647 |
| Producer | 4.0 | 2147483647 |
| Producer | 4.1 | 2147483647 |
| Producer | 4.2 | 2147483647 |
| Producer | 4.3 | 2147483647 |
| Producer | 4.4 | 2147483647 |
| Kafka Streams | 1.1 | 0 |
| Kafka Streams | 2.0 | 0 |
| Kafka Streams | 2.1 | 0 |
| Kafka Streams | 2.2 | 0 |
| Kafka Streams | 2.3 | 0 |
| Kafka Streams | 2.4 | 0 |
| Kafka Streams | 2.5 | 0 |
| Kafka Streams | 2.6 | 0 |
| Kafka Streams | 2.7 | 0 |
| Kafka Streams | 2.8 | 0 |
| Kafka Streams | 3.0 | 0 |
| Kafka Streams | 3.1 | 0 |
| Kafka Streams | 3.2 | 0 |
| Kafka Streams | 3.3 | 0 |
| Kafka Streams | 3.4 | 0 |
| Kafka Streams | 3.5 | 0 |
| Kafka Streams | 3.6 | 0 |
| Kafka Streams | 3.7 | 0 |
| Kafka Streams | 3.8 | 0 |
| Kafka Streams | 3.9 | 0 |
Tuning Recommendation
Workload-dependent proposals, not benchmarked defaults. Review the versioned Config Advisor before applying.
| Profile | Proposal | Rationale and tradeoff |
|---|---|---|
| producer / throughput | 2147483647 | Allows retryable produce failures to be retried; delivery.timeout.ms also bounds delivery in clients that support it. Tradeoff: Retries do not handle every error. Applications must inspect send futures or callbacks and handle failed or ambiguous outcomes. Reference · 2026-10-27 |
| producer / durability | 2147483647 | Allows retryable produce failures to be retried; delivery.timeout.ms also bounds delivery in clients that support it. Tradeoff: Retries do not handle every error. Applications must inspect send futures or callbacks and handle failed or ambiguous outcomes. Reference · 2026-10-27 |
Related Configs
acks · enable.idempotence · max.in.flight.requests.per.connection · delivery.timeout.ms · retry.backoff.ms · retry.backoff.max.ms · request.timeout.ms