Search code examples
apache-kafkakafka-producer-api

How does the request.timeout.ms of producer config and request.timeout.ms of broker config play together


I'm trying to understand the request timeout mechanism from the producer end. Let's say I have below configurations set

Producer Configurations:
delivery.timeout.ms = 15000
request.timeout.ms = 10000 
linger.ms = 0
reconnect.backoff.ms = 50

Broker configurations:
request.timeout.ms = 30000 

Now, if I send a message at time t1 and the cluster is down, how long does the producer wait before throwing connection exception?


Solution

  • I ran a test and observed that send() is failing with below exception

    Failed to send; nested exception is org.apache.kafka.common.errors.TimeoutException: Topic test.topic not present in metadata after 45000 ms

    in this 45000 ms is the 'max.block.ms'.