There are bunch of config provided by Apache HttpClient5 to modify how you use the client. But, these seems to be the most important: RequestConfig, and CloseableHttpAsyncClient, which includes IOReactorConfig and PoolingAsyncClientConnectionManager, which then includes ConnectionConfig. Here is the hierarchy of how I list them and what I think they mean based on the information I have found:
I am not sure how are these related or different from each other. Can anyone provide an explanation if my understanding of them are incorrect or how they are related, and how I can use them in my services, that uses this underlying client?
IOReactorConfig
represents the I/O reactor level configuration parameters applicable to the I/O selector and I/O channels created and managed by the reactor. This is the lowest level of configuration parameters. These configuration parameters are specific to the async (event-driven) I/O transport. SocketConfig
is the classic (blocking) I/O transport equivalent. These parameters apply prior to the connection setup or TLS handshake
ConnectionConfig
represents the connection management level configuration parameters applicable to individual HTTP connections and NOT specific to an I/O transport model. They work the same way with the classic and the async transports. These parameters apply to connections during their entire life time. There is a certain overlap with the I/O transport model specific parameters, for instance the socket timeout, can optionally override that defined at the I/O channel level.
TlsConfig
represents TLS handshake specific configuration parameters applicable to individual connections during the TLS handshake in some cases before the connection setup is fully complete. There is a certain overlap with the I/O transport model specific parameters, for instance the socket timeout, can optionally override that defined at the I/O channel level for the duration of the TLS handshake. This is also the configuration level that defines the HTTP protocol negotiation policy.
Http1Config
represents the HTTP/1.1 protocols specific configuration parameters applicable to HTTP/1.1 and HTTP/1.0 connections. These parameters apply post the connection setup and prior to individual message exchanages.
H2Config
represents the HTTP/2 protocols specific configuration parameters applicable to HTTP/2 connections. These parameters apply post the connection setup and prior to individual message exchanges.
RequestConfig
represents the request level configuration parameters applicable to individual HTTP message exchanges and NOT specific to an I/O transport model. This is the topmost level of configuration parameters. These parameters apply in the course of the request / response message exchange post the connection setup (that includes the complete route negotiation, TLS handshake, proxy tunnel setup, etc). There is a certain overlap with the connection management level parameters, for instance the response timeout, can optionally override the socket defined at the connection level.
For completeness there are also CharCodingConfig
that apply to text based connections and CacheConfig
that apply to HTTP caches.