DNS query timeout takes 20s! How can I configure to reduce the timeout period?

I am using the Keycloak SimpleHttp class in a Keycloak extension that make a HTTP call to an external service.

I want to setup the DNS query timeout timeout as below but it don’t work:

  1. QUARKUS_VERTX_RESOLVER_QUERY_TIMEOUT=PT5S (default 5s)
  2. QUARKUS_VERTX_RESOLVER_MAX_QUERIES=1 (default 4)

The SimpleHttp call hang for 20s (5s x 4 = 20s ???) on DNS resolution timeout. (with UnknownHostException)

Can you please suggest a solution?

Thank you.

The SimpleHttp class uses an instance of the Apache HttpClient, not Vertx. Thus, your configs won’t work.
Your options for configuring the Apache HttpClient are here: Configuring outgoing HTTP requests - Keycloak

I have a look of that page and seems no setting for configuring the DNS query timeout!

Tried ‘socket-timeout-millis’, ‘establish-connection-timeout-millis’ but no luck.

Not sure if we can somehow globally change the DNS query timeout?

Also, do you know why the timeout is 20s?

Thank you.