2

We are building an application using the new (well comparatively) Java HttpClient that was added in Java 11. We are on Java 12. Overall the API is nice, but I can't find anything related to persistent connections. Most other similar APIs support connection pooling and persistent connections in some way, but as far as I can see it is not mentioned in the documentation.

We really want to keep the connections alive to reduce the latency for TLS handshakes and it would be nice to have some control over how it is done.

Is this supported and documented somewhere? Or is the client using persistent connections automatically under the cover, but without any API to control how it is done? Or is it not supported at all?

ewramner
  • 5,810
  • 2
  • 17
  • 33
  • Note: that duplicate does not mention where such things are documented, but that part of the question is dipping in off-topic territory; thou shalt not ask for offsite resources. – Gimby Sep 24 '19 at 14:41
  • Well, asking for the information source is hardly off topic. I found the constants in https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/master/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java. I found no other documentation for the system properties, but code is king. – ewramner Sep 24 '19 at 14:54
  • No, code is not king. The contract is king. Implementation can change from release to release, but the contract cannot. – VGR Sep 24 '19 at 15:51
  • Which is why I was asking for supported documentation, but as far as I can see there is none. I would have preferred documented options or ideally a programmatic API. Lacking both at least the code is an authoritative source for the current state of affairs. – ewramner Sep 24 '19 at 17:43

0 Answers0