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 Details

  • 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 interface Toggleable
      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

      public Optional<Duration> getAcquireTimeout()
      The time to wait to acquire a connection. [available in the Netty HTTP client]
      Returns:
      The timeout as a duration.
    • setAcquireTimeout

      public void setAcquireTimeout(@Nullable @Nullable Duration acquireTimeout)
      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