You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by shruti pandey <sh...@gmail.com> on 2023/02/13 13:44:50 UTC

Timeout not getting applied on KafkaAdminClient.create

Hi,

I want to add timeout for KafkaAdminClient creation.

AdminClient admin1 = KafkaAdminClient.create(properties);

I have thread which gets killed after 10seconds. I want that if
KafkaAdminClient creation is taking more time it should timeout. But when
kafka-broker is not present my code gets stuck at above step
I have added AdminClientConfig.REQUEST_TIMEOUT_MS_CONFIG and
AdminClientConfig.DEFAULT_API_TIMEOUT_MS_CONFIG. but the value is not
getting picked.
Also it takes more than 30second which is the default timeout -
These are the log stackTrace when thread is
killed='[java.base@17.0.6/java.lang.Object.wait(Native
Method), java.base@17.0.6/java.lang.Thread.join(Thread.java:1298),
org.apache.kafka.clien
ts.admin.KafkaAdminClient.close(KafkaAdminClient.java:654),
org.apache.kafka.clients.admin.Admin.close(Admin.java:153)

Let me know if there are any params to configured here for timeout to
happen.

Thanks,
Shruti