public static class HttpClientProperties.HttpClientPropertiesBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
HttpClientProperties |
build() |
HttpClientProperties.HttpClientPropertiesBuilder |
keepAlive(boolean keepAlive)
Set whether 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.
|
HttpClientProperties.HttpClientPropertiesBuilder |
routePlanner(org.apache.http.conn.routing.HttpRoutePlanner routePlanner)
Overrides the
proxy parameter, and can be used to create more complex proxies. |
HttpClientProperties.HttpClientPropertiesBuilder |
supportedProtocols(String[] tlsProtocols)
Sets the list of supported SSL/TLS protocols.
|
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.HttpClientPropertiesBuilder routePlanner(org.apache.http.conn.routing.HttpRoutePlanner routePlanner)
proxy parameter, and can be used to create more complex proxies.routePlanner - the custom route plannerpublic HttpClientProperties.HttpClientPropertiesBuilder supportedProtocols(String[] tlsProtocols)
tlsProtocols - the list of supported protocolspublic HttpClientProperties build()
Copyright © 2024. All rights reserved.