conduktor.io ↗

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

Kafka VersionDefault Value
0.9.060000
0.10.060000
0.10.160000
0.10.260000
0.11.060000
1.060000
1.160000
2.060000
2.160000
2.260000
2.360000
2.460000
2.560000
2.660000 (1 minute)
2.760000 (1 minute)
2.860000 (1 minute)
3.060000 (1 minute)
3.160000 (1 minute)
3.260000 (1 minute)
3.360000 (1 minute)
3.460000 (1 minute)
3.560000 (1 minute)
3.660000 (1 minute)
3.760000 (1 minute)
3.860000 (1 minute)
3.960000 (1 minute)
4.060000 (1 minute)
4.160000 (1 minute)
4.260000 (1 minute)

Tuning Recommendation

ProfileRecommendedWhy
producer / latency1000Reducing the send() block timeout to 1s prevents the calling thread from stalling for up to 60s when buffer.memory is exhausted; instead it fails fast with a BufferExhaustedException that the application can handle (drop, circuit-break, or shed load).
producer / durability60000The 60s block timeout allows send() to wait for buffer.memory to free up during sustained broker outages, keeping backpressure transparent to the application and preventing data loss from rejected sends during transient failures.

Related Configs

buffer.memory · delivery.timeout.ms · batch.size

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