How to keep connection alive in Java 11 http client
I'm using the Java 11 HttpClient with HTTP/2 and need to keep connection alive for few minutes, but the builder does not have the option to set it. Is there a way to specify this and make client keep the connection alive for some time? If you build a standard HttpClient e.g. using HttpClient.newHttpClient(); by default a connection pool is created. This pool keeps the connections alive by default for 1200 seconds (20 minutes). If you want to change the keep-alive timeout you can do so using the property jdk.httpclient.keepalive.timeout . However the value is only read once when the class jdk