Package io.micronaut.http.client
Class HttpClientConfiguration.ConnectionPoolConfiguration
java.lang.Object
io.micronaut.http.client.HttpClientConfiguration.ConnectionPoolConfiguration
- All Implemented Interfaces:
Toggleable
- Direct Known Subclasses:
DefaultHttpClientConfiguration.DefaultConnectionPoolConfiguration
,ServiceHttpClientConfiguration.ServiceConnectionPoolConfiguration
- Enclosing class:
- HttpClientConfiguration
public static class HttpClientConfiguration.ConnectionPoolConfiguration
extends Object
implements Toggleable
Configuration for the HTTP client connnection pool.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
The default enable value.static final String
The prefix to use for configuration. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe time to wait to acquire a connection.int
The maximum number of concurrent HTTP1 connections in the pool.int
The maximum number of concurrent HTTP2 connections in the pool.int
The maximum number of requests (streams) that can run concurrently on one HTTP2 connection.int
Maximum number of futures awaiting connection acquisition.int
The maximum number of pending (new) connections before they are assigned to a pool.boolean
Whether connection pooling is enabled.void
setAcquireTimeout
(@Nullable Duration acquireTimeout) Sets the timeout to wait for a connection.void
setEnabled
(boolean enabled) Sets whether connection pooling is enabled.void
setMaxConcurrentHttp1Connections
(int maxConcurrentHttp1Connections) The maximum number of concurrent HTTP1 connections in the pool.void
setMaxConcurrentHttp2Connections
(int maxConcurrentHttp2Connections) The maximum number of concurrent HTTP2 connections in the pool.void
setMaxConcurrentRequestsPerHttp2Connection
(int maxConcurrentRequestsPerHttp2Connection) The maximum number of requests (streams) that can run concurrently on one HTTP2 connection.void
setMaxPendingAcquires
(int maxPendingAcquires) Sets the max pending acquires.void
setMaxPendingConnections
(int maxPendingConnections) The maximum number of pending (new) connections before they are assigned to a pool.
-
Field Details
-
PREFIX
The prefix to use for configuration.- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
-
Constructor Details
-
ConnectionPoolConfiguration
public ConnectionPoolConfiguration()
-
-
Method Details
-
isEnabled
public boolean isEnabled()Whether connection pooling is enabled. [available in the Netty HTTP client]- Specified by:
isEnabled
in interfaceToggleable
- Returns:
- True if connection pooling is enabled
-
setEnabled
public void setEnabled(boolean enabled) Sets whether connection pooling is enabled. Default value (true).- Parameters:
enabled
- True if it is enabled
-
getMaxPendingAcquires
public int getMaxPendingAcquires()Maximum number of futures awaiting connection acquisition. Defaults to no maximum. [available in the Netty HTTP client]- Returns:
- The max pending requires
-
setMaxPendingAcquires
public void setMaxPendingAcquires(int maxPendingAcquires) Sets the max pending acquires.- Parameters:
maxPendingAcquires
- The max pending acquires
-
getAcquireTimeout
The time to wait to acquire a connection. [available in the Netty HTTP client]- Returns:
- The timeout as a duration.
-
setAcquireTimeout
Sets the timeout to wait for a connection.- Parameters:
acquireTimeout
- The acquire timeout
-
getMaxPendingConnections
public int getMaxPendingConnections()The maximum number of pending (new) connections before they are assigned to a pool. [available in the Netty HTTP client]- Returns:
- The maximum number of pending connections
- Since:
- 4.0.0
-
setMaxPendingConnections
public void setMaxPendingConnections(int maxPendingConnections) The maximum number of pending (new) connections before they are assigned to a pool.- Parameters:
maxPendingConnections
- The maximum number of pending connections- Since:
- 4.0.0
-
getMaxConcurrentRequestsPerHttp2Connection
public int getMaxConcurrentRequestsPerHttp2Connection()The maximum number of requests (streams) that can run concurrently on one HTTP2 connection. [available in the Netty HTTP client]- Returns:
- The maximum concurrent request count
- Since:
- 4.0.0
-
setMaxConcurrentRequestsPerHttp2Connection
public void setMaxConcurrentRequestsPerHttp2Connection(int maxConcurrentRequestsPerHttp2Connection) The maximum number of requests (streams) that can run concurrently on one HTTP2 connection.- Parameters:
maxConcurrentRequestsPerHttp2Connection
- The maximum concurrent request count- Since:
- 4.0.0
-
getMaxConcurrentHttp1Connections
public int getMaxConcurrentHttp1Connections()The maximum number of concurrent HTTP1 connections in the pool. [available in the Netty HTTP client]- Returns:
- The maximum concurrent connection count
- Since:
- 4.0.0
-
setMaxConcurrentHttp1Connections
public void setMaxConcurrentHttp1Connections(int maxConcurrentHttp1Connections) The maximum number of concurrent HTTP1 connections in the pool.- Parameters:
maxConcurrentHttp1Connections
- The maximum concurrent connection count- Since:
- 4.0.0
-
getMaxConcurrentHttp2Connections
public int getMaxConcurrentHttp2Connections()The maximum number of concurrent HTTP2 connections in the pool. [available in the Netty HTTP client]- Returns:
- The maximum concurrent connection count
- Since:
- 4.0.0
-
setMaxConcurrentHttp2Connections
public void setMaxConcurrentHttp2Connections(int maxConcurrentHttp2Connections) The maximum number of concurrent HTTP2 connections in the pool.- Parameters:
maxConcurrentHttp2Connections
- The maximum concurrent connection count- Since:
- 4.0.0
-