public static class HttpClientProperties.HttpClientPropertiesBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
HttpClientProperties |
build() |
HttpClientProperties.HttpClientPropertiesBuilder |
keepAlive(boolean keepAlive)
Set whether or not a custom connection keep-alive time should be used.
|
HttpClientProperties.HttpClientPropertiesBuilder |
maxConnectionsPerRoute(Integer maxConnections)
Sets the maximum number of connections the client may keep open at the same time for the same route (endpoint).
|
HttpClientProperties.HttpClientPropertiesBuilder |
maxConnectionsTotal(Integer maxConnectionsTotal)
Sets the total maximum number of connections the client may keep open at the same time.
|
HttpClientProperties.HttpClientPropertiesBuilder |
maxIdleTime(Integer maxIdleTime)
Set the maximum time persistent connections can stay idle while kept alive in the connection pool.
|
HttpClientProperties.HttpClientPropertiesBuilder |
maxKeepAliveTime(Integer maxKeepAliveTime)
Sets the time a connection can remain idle as part of the keep-alive strategy.
|
HttpClientProperties.HttpClientPropertiesBuilder |
proxy(org.apache.http.HttpHost proxy)
Sets a proxy server to use for the client.
|
public HttpClientProperties.HttpClientPropertiesBuilder maxIdleTime(Integer maxIdleTime)
maxIdleTime - the maximum idle time expressed in secondspublic HttpClientProperties.HttpClientPropertiesBuilder keepAlive(boolean keepAlive)
false, the HTTP
client will use the default connection keep-alive strategy, which is to use only the server instructions
(if any) set in the Keep-Alive response header.
If set to true, the HTTP client will use a custom connection keep-alive strategy which uses the
server instructions set in the Keep-Alive response header; if the response doesn't contain a
Keep-Alive header, the client will use a default keep-alive period which is configurable via
maxKeepAliveTime(Integer).keepAlive - set to false to use a default keep-alive strategy or to true to use a
custom onemaxKeepAliveTime(Integer),
Keep-Alivepublic HttpClientProperties.HttpClientPropertiesBuilder maxKeepAliveTime(Integer maxKeepAliveTime)
true.
Defaults to 120 seconds (2 minutes).maxKeepAliveTime - the maximum time a connection may remain idle, expressed in secondspublic HttpClientProperties.HttpClientPropertiesBuilder maxConnectionsTotal(Integer maxConnectionsTotal)
maxConnectionsTotal - the total maximum number of connectionspublic HttpClientProperties.HttpClientPropertiesBuilder maxConnectionsPerRoute(Integer maxConnections)
maxConnections - the maximum number of connections per routepublic HttpClientProperties.HttpClientPropertiesBuilder proxy(org.apache.http.HttpHost proxy)
proxy - the proxy serverpublic HttpClientProperties build()
Copyright © 2023. All rights reserved.