Class Http2ClientConfig
java.lang.Object
io.vertx.core.http.Http2ClientConfig
HTTP/2 client configuration.
- Author:
- Julien Viet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanintintbooleanbooleansetClearTextUpgrade(boolean value) Set totruewhen an h2c connection is established using an HTTP/1.1 upgrade request, andfalsewhen an h2c connection is established directly (with prior knowledge).setClearTextUpgradeWithPreflightRequest(boolean value) Set totruewhen an h2c connection established using an HTTP/1.1 upgrade request should perform a preflightOPTIONSrequest to the origin server to establish the h2c connection.setConnectionWindowSize(int connectionWindowSize) Set the default HTTP/2 connection window size.setInitialSettings(Http2Settings settings) Set the HTTP/2 connection settings immediately sent by to the server when the client connects.setKeepAliveTimeout(Duration keepAliveTimeout) Set the keep alive timeout for HTTP/2 connections.setMultiplexImplementation(boolean multiplexImplementation) Set which HTTP/2 implementation to usesetMultiplexingLimit(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.setUpgradeMaxContentLength(int upgradeMaxContentLength) Set the HTTP/2 upgrade maximum length of the aggregated content in bytes.
-
Constructor Details
-
Http2ClientConfig
public Http2ClientConfig() -
Http2ClientConfig
-
-
Method Details
-
getMultiplexingLimit
public int getMultiplexingLimit()- Returns:
- the maximum number of concurrent streams for an HTTP/2 connection,
-1means the value sent by the server
-
setMultiplexingLimit
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-1means to use the value sent by the server's initial settings.-1is 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
Set the default HTTP/2 connection window size. It overrides the initial window size set byHttp2Settings.getInitialWindowSize(), so the connection window size is greater than for its streams, in order the data throughput. A value of-1reuses 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
- Returns:
- the keep alive timeout value in seconds for HTTP/2 connections
-
setKeepAliveTimeout
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
nullmeans 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
Set the HTTP/2 upgrade maximum length of the aggregated content in bytes. This is only taken into account whenisClearTextUpgradeWithPreflightRequest()is set tofalse(which is the default). WhenisClearTextUpgradeWithPreflightRequest()istrue, 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
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
- Returns:
- the initial HTTP/2 connection settings
-
setInitialSettings
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:
truewhen an h2c connection is established using an HTTP/1.1 upgrade request,falsewhen directly
-
setClearTextUpgrade
Set totruewhen an h2c connection is established using an HTTP/1.1 upgrade request, andfalsewhen 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:
truewhen an h2c connection established using an HTTP/1.1 upgrade request should perform a preflightOPTIONSrequest to the origin server to establish the h2c connection
-
setClearTextUpgradeWithPreflightRequest
Set totruewhen an h2c connection established using an HTTP/1.1 upgrade request should perform a preflightOPTIONSrequest 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
-