Package com.oracle.bmc.http
Class ConnectionPoolingApacheConfigurator
- java.lang.Object
-
- com.oracle.bmc.http.ApacheConfigurator
-
- com.oracle.bmc.http.ConnectionPoolingApacheConfigurator
-
- All Implemented Interfaces:
ClientConfigurator,HasApacheConnectorProperties,SetsClientBuilderProperties
public class ConnectionPoolingApacheConfigurator extends ApacheConfigurator
ApacheConfiguratorconfigurator that applies connection-pool friendly defaults for the Jersey Apache connector.It requires an
ApacheConnectionPoolConfigdescribing the desired pool size and idle timeout and configures the underlying client as follows:- forces connection pooling and applies the provided
ApacheConnectionPoolConfig - installs a keep-alive strategy that honours the server timeout header and falls back to the configured idle timeout
- works around the Apache HTTP client stream-closing race in versions prior to 4.5
- sets
NoopUserTokenHandlerto avoid pinning pooled connections to a user principal
Typical usage:
ApacheConnectionPoolConfig poolConfig = ApacheConnectionPoolConfig.builder() .defaultMaxConnectionsPerRoute(512) .totalOpenConnections(2_048) .idleConnectionTimeoutInMillis(5_000L) .build();ClientConfigurator configurator = new ConnectionPoolingApacheConfigurator(poolConfig);
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConnectionPoolingApacheConfigurator.CustomConnectionKeepAliveStrategyKeep-alive strategy that honours the server-provided timeout when present while falling back to the configured default.-
Nested classes/interfaces inherited from class com.oracle.bmc.http.ApacheConfigurator
ApacheConfigurator.NonBuffering
-
-
Field Summary
-
Fields inherited from class com.oracle.bmc.http.ApacheConfigurator
apacheConnectorProperties, clientConfigDecorators
-
-
Constructor Summary
Constructors Constructor Description ConnectionPoolingApacheConfigurator(ApacheConnectionPoolConfig poolConfig)
-
Method Summary
-
Methods inherited from class com.oracle.bmc.http.ApacheConfigurator
customizeBuilder, customizeClient, customizeRequest, getApacheConnectorProperties, setConnectorProvider, setSslContext
-
-
-
-
Constructor Detail
-
ConnectionPoolingApacheConfigurator
public ConnectionPoolingApacheConfigurator(ApacheConnectionPoolConfig poolConfig)
-
-