Currently lib-httpclient uses OkHttpClient. There are a few problems with it:
OkHttpClient written in Kotlin and entire Kotlin lib bundled into application jar. App jar becomes quite big
During build time OSGi looks for annotations in all the classes, including Kotlin lib classes. It adds a few seconds to application build time
The way OKHttpclient is used (and it is dictated by current lib-http-client) API , entire HttpcCient instance with a new thread pool is created
Is we switch to Java 11 HttpClient we don't need to bundle Kotlin lib, nor any additional classes - as they are part of JDK. It will lead to faster builds and smaller artifacts.
It is a "major version" change and we can take a chance to change the API so it does not require us to create a new connection every time. (connectTimeout, certificates and clientCertificate are connection related)
Currently lib-httpclient uses OkHttpClient. There are a few problems with it:
Is we switch to Java 11 HttpClient we don't need to bundle Kotlin lib, nor any additional classes - as they are part of JDK. It will lead to faster builds and smaller artifacts.
It is a "major version" change and we can take a chance to change the API so it does not require us to create a new connection every time. (
connectTimeout
,certificates
andclientCertificate
are connection related)