delivery.timeout.ms — Kafka Producer Configuration
An upper bound on the time to report success or failure after a call to send() returns. This limits the total time that a record will be delayed prior to sending, the time to await acknowledgement from the broker (if expected), and the time allowed for retriable send failures.
Description
An upper bound on the time to report success or failure after a call to send() returns. This limits the total time that a record will be delayed prior to sending, the time to await acknowledgement from the broker (if expected), and the time allowed for retriable send failures. The producer may report failure to send a record earlier than this config if either an unrecoverable error is encountered, the retries have been exhausted, or the record is added to a batch which reached an earlier delivery expiration deadline. The value of this config should be greater than or equal to the sum of request.timeout.ms and linger.ms.
Default Values by Kafka Version
| Kafka Version | Default Value |
|---|---|
| 2.1 | 120000 |
| 2.2 | 120000 |
| 2.3 | 120000 |
| 2.4 | 120000 |
| 2.5 | 120000 |
| 2.6 | 120000 (2 minutes) |
| 2.7 | 120000 (2 minutes) |
| 2.8 | 120000 (2 minutes) |
| 3.0 | 120000 (2 minutes) |
| 3.1 | 120000 (2 minutes) |
| 3.2 | 120000 (2 minutes) |
| 3.3 | 120000 (2 minutes) |
| 3.4 | 120000 (2 minutes) |
| 3.5 | 120000 (2 minutes) |
| 3.6 | 120000 (2 minutes) |
| 3.7 | 120000 (2 minutes) |
| 3.8 | 120000 (2 minutes) |
| 3.9 | 120000 (2 minutes) |
| 4.0 | 120000 (2 minutes) |
| 4.1 | 120000 (2 minutes) |
| 4.2 | 120000 (2 minutes) |
Tuning Recommendation
| Profile | Recommended | Why |
|---|---|---|
| producer / throughput | 300000 | Extending the delivery timeout to 5 minutes gives more headroom for retries during rolling restarts or leader elections without requiring operator intervention, preventing spurious TimeoutExceptions at scale. |
| producer / latency | 10000 | Capping the total delivery window at 10s bounds how long a record can stay in the accumulator waiting for delivery; failed records surface as exceptions quickly rather than silently blocking buffer.memory and inflating tail latency. |
| producer / durability | 300000 | Extending the delivery window to 5 minutes accommodates extended broker unavailability (rolling restarts, leader elections, controller failover) without failing records; in a well-operated cluster this is never reached under normal conditions. |
Related Configs
retries · retry.backoff.ms · retry.backoff.max.ms · request.timeout.ms · max.block.ms · linger.ms · acks · transaction.timeout.ms · buffer.memory