max.block.ms — Kafka Producer Configuration
The configuration controls how long the KafkaProducer's send(), partitionsFor(), initTransactions(), sendOffsetsToTransaction(), commitTransaction() and abortTransaction() methods will block. For send() this timeout bounds the total time waiting for both metadata fetch and buffer allocation (blocking in the user-supplied serializers or partitioner is not counted against this timeout)
Description
The configuration controls how long the KafkaProducer's send(), partitionsFor(), initTransactions(), sendOffsetsToTransaction(), commitTransaction() and abortTransaction() methods will block. For send() this timeout bounds the total time waiting for both metadata fetch and buffer allocation (blocking in the user-supplied serializers or partitioner is not counted against this timeout). For partitionsFor() this timeout bounds the time spent waiting for metadata if it is unavailable. The transaction-related methods always block, but may timeout if the transaction coordinator could not be discovered or did not respond within the timeout.
Default Values by Kafka Version
| Component | Kafka version line | Documented default |
|---|---|---|
| Producer | 0.9.0 | 60000 |
| Producer | 0.10.0 | 60000 |
| Producer | 0.10.1 | 60000 |
| Producer | 0.10.2 | 60000 |
| Producer | 0.11.0 | 60000 |
| Producer | 1.0 | 60000 |
| Producer | 1.1 | 60000 |
| Producer | 2.0 | 60000 |
| Producer | 2.1 | 60000 |
| Producer | 2.2 | 60000 |
| Producer | 2.3 | 60000 |
| Producer | 2.4 | 60000 |
| Producer | 2.5 | 60000 |
| Producer | 2.6 | 60000 (1 minute) |
| Producer | 2.7 | 60000 (1 minute) |
| Producer | 2.8 | 60000 (1 minute) |
| Producer | 3.0 | 60000 (1 minute) |
| Producer | 3.1 | 60000 (1 minute) |
| Producer | 3.2 | 60000 (1 minute) |
| Producer | 3.3 | 60000 (1 minute) |
| Producer | 3.4 | 60000 (1 minute) |
| Producer | 3.5 | 60000 (1 minute) |
| Producer | 3.6 | 60000 (1 minute) |
| Producer | 3.7 | 60000 (1 minute) |
| Producer | 3.8 | 60000 (1 minute) |
| Producer | 3.9 | 60000 (1 minute) |
| Producer | 4.0 | 60000 (1 minute) |
| Producer | 4.1 | 60000 (1 minute) |
| Producer | 4.2 | 60000 (1 minute) |
| Producer | 4.3 | 60000 (1 minute) |
| Producer | 4.4 | 60000 (1 minute) |
Tuning Recommendation
Workload-dependent proposals, not benchmarked defaults. Review the versioned Config Advisor before applying.
| Profile | Proposal | Rationale and tradeoff |
|---|---|---|
| producer / latency | 1000 | Bounds blocking in producer API calls for metadata and buffer availability; it is separate from asynchronous delivery timing. Tradeoff: The application thread can block for this duration. User serializer or partitioner time is not included in the documented send() bound. Reference · 2026-10-27 |
| producer / durability | 60000 | Bounds blocking in producer API calls for metadata and buffer availability; it is separate from asynchronous delivery timing. Tradeoff: The application thread can block for this duration. User serializer or partitioner time is not included in the documented send() bound. Reference · 2026-10-27 |
Related Configs
buffer.memory · delivery.timeout.ms · batch.size