Class Http2ClientConfig

java.lang.Object
io.vertx.core.http.Http2ClientConfig

@Unstable public class Http2ClientConfig extends Object
HTTP/2 client configuration.
Author:
Julien Viet
  • Constructor Details

    • Http2ClientConfig

      public Http2ClientConfig()
    • Http2ClientConfig

      public Http2ClientConfig(Http2ClientConfig other)
  • Method Details

    • getMultiplexingLimit

      public int getMultiplexingLimit()
      Returns:
      the maximum number of concurrent streams for an HTTP/2 connection, -1 means the value sent by the server
    • setMultiplexingLimit

      public Http2ClientConfig setMultiplexingLimit(int limit)
      Set a client limit of the number concurrent streams for each HTTP/2 connection, this limits the number of streams the client can create for a connection. The effective number of streams for a connection is the min of this value and the server's initial settings.

      Setting the value to -1 means to use the value sent by the server's initial settings. -1 is the default value.

      Parameters:
      limit - the maximum concurrent for an HTTP/2 connection
      Returns:
      a reference to this, so the API can be used fluently
    • getConnectionWindowSize

      public int getConnectionWindowSize()
      Returns:
      the default HTTP/2 connection window size
    • setConnectionWindowSize

      public Http2ClientConfig setConnectionWindowSize(int connectionWindowSize)
      Set the default HTTP/2 connection window size. It overrides the initial window size set by Http2Settings.getInitialWindowSize(), so the connection window size is greater than for its streams, in order the data throughput.

      A value of -1 reuses the initial window size setting.

      Parameters:
      connectionWindowSize - the window size applied to the connection
      Returns:
      a reference to this, so the API can be used fluently
    • getKeepAliveTimeout

      public Duration getKeepAliveTimeout()
      Returns:
      the keep alive timeout value in seconds for HTTP/2 connections
    • setKeepAliveTimeout

      public Http2ClientConfig setKeepAliveTimeout(Duration keepAliveTimeout)

      Set the keep alive timeout for HTTP/2 connections. This value determines how long a connection remains unused in the pool before being evicted and closed. A timeout of zero or null means there is no timeout.

      Parameters:
      keepAliveTimeout - the timeout, in seconds
      Returns:
      a reference to this, so the API can be used fluently
    • getUpgradeMaxContentLength

      public int getUpgradeMaxContentLength()
      Returns:
      the HTTP/2 upgrade maximum length of the aggregated content in bytes
    • setUpgradeMaxContentLength

      public Http2ClientConfig setUpgradeMaxContentLength(int upgradeMaxContentLength)
      Set the HTTP/2 upgrade maximum length of the aggregated content in bytes. This is only taken into account when isClearTextUpgradeWithPreflightRequest() is set to false (which is the default). When isClearTextUpgradeWithPreflightRequest() is true, then the client makes a preflight OPTIONS request and the upgrade will not send a body, voiding the requirements.
      Parameters:
      upgradeMaxContentLength - the length, in bytes
      Returns:
      a reference to this, so the API can be used fluently
    • getMultiplexImplementation

      public boolean getMultiplexImplementation()
      Returns:
      whether to use the HTTP/2 implementation based on multiplexed channel
    • setMultiplexImplementation

      public Http2ClientConfig setMultiplexImplementation(boolean multiplexImplementation)
      Set which HTTP/2 implementation to use
      Parameters:
      multiplexImplementation - whether to use the HTTP/2 multiplex implementation
      Returns:
      a reference to this, so the API can be used fluently
    • getInitialSettings

      public Http2Settings getInitialSettings()
      Returns:
      the initial HTTP/2 connection settings
    • setInitialSettings

      public Http2ClientConfig setInitialSettings(Http2Settings settings)
      Set the HTTP/2 connection settings immediately sent by to the server when the client connects.
      Parameters:
      settings - the settings value
      Returns:
      a reference to this, so the API can be used fluently
    • isClearTextUpgrade

      public boolean isClearTextUpgrade()
      Returns:
      true when an h2c connection is established using an HTTP/1.1 upgrade request, false when directly
    • setClearTextUpgrade

      public Http2ClientConfig setClearTextUpgrade(boolean value)
      Set to true when an h2c connection is established using an HTTP/1.1 upgrade request, and false when an h2c connection is established directly (with prior knowledge).
      Parameters:
      value - the upgrade value
      Returns:
      a reference to this, so the API can be used fluently
    • isClearTextUpgradeWithPreflightRequest

      public boolean isClearTextUpgradeWithPreflightRequest()
      Returns:
      true when an h2c connection established using an HTTP/1.1 upgrade request should perform a preflight OPTIONS request to the origin server to establish the h2c connection
    • setClearTextUpgradeWithPreflightRequest

      public Http2ClientConfig setClearTextUpgradeWithPreflightRequest(boolean value)
      Set to true when an h2c connection established using an HTTP/1.1 upgrade request should perform a preflight OPTIONS request to the origin server to establish the h2c connection.
      Parameters:
      value - the upgrade value
      Returns:
      a reference to this, so the API can be used fluently