Difference between request.timeout.ms and timeout.ms properties of Kafka producer

vatsal mevada picture vatsal mevada · Nov 24, 2016 · Viewed 14.3k times · Source

Refering the kafka documentation, a Kafka message prducer configuration have request.timeout.ms and timeout.ms properties. Reading the discription of these two properties, I am not able clearly distinguish between them.

Can anyone explain the difference using small example.

Answer

yaswanth picture yaswanth · Nov 24, 2016

request.timeout.ms is the timeout configured on the client side. It says that the client is going to wait this much time for the server to respond to a request.

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. The leader will wait timeout.ms amount of time for all the followers to respond.

So client sends a request to the server (leader). Based on the acks setting, the server will either wait or respond back to the client. timeout.ms is the amount of time the leader waits for its followers whereas request.timeout.ms is the amount of time the client waits for the server(leader).