Given the below synchronous kafka producer
Properties props = new Properties();
props.put("max.block.ms", 30000);
props.put("request.timeout.ms", 30000);
props.put("retries", 5);
KafkaProducer<String, byte[]> produce = new KafkaProducer<>(props);
//Send message
producer.send(producerRecord).get();
help me understand the difference between request.timeout.ms and max.block.ms producer configs. Does either include max time for all retries? Or does each retry have its own timeout?
timeout.ms is the timeout configured on the leader in the Kafka cluster. This is the timeout on the server side. For example if you have set the acks setting to all, the server will not respond until all of its followers have sent a response back to the leader.
max.block.ms is used for producer to block buffer time, serialization time etc. For details look at this one.
request.timeout.ms is used to timeout request, I would set this to the maximum time I can wait for the response.
max.block.ms is used for producer to block buffer time, serialization time etc.
For details look at this one. https://cwiki.apache.org/confluence/display/KAFKA/KIP-19+-+Add+a+request+timeout+to+NetworkClient
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With