Package com.azure.cosmos
Class Http2ConnectionConfig
java.lang.Object
com.azure.cosmos.Http2ConnectionConfig
Represents the http2 connection config associated with Cosmos Client in the Azure Cosmos DB database service.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the maximum number of the concurrent streams that can be opened to the remote peer.Get the maximum number of live connections to keep in the pool.Get the minimum number of live connections to keep in the pool (can be the best effort).return the flag to indicate whether http2 is enabled.setEnabled(Boolean enabled) Configure the flag to indicate whether http2 is enabled.setMaxConcurrentStreams(Integer maxConcurrentStreams) Configures the maximum number of the concurrent streams that can be opened to the remote peer.setMaxConnectionPoolSize(Integer maxConnectionPoolSize) Configures the maximum number of live connections to keep in the pool.setMinConnectionPoolSize(Integer minConnectionPoolSize) Configures the minimum number of live connections to keep in the pool (can be the best effort).
-
Constructor Details
-
Http2ConnectionConfig
public Http2ConnectionConfig()The constructor of Http2ConnectionConfig.
-
-
Method Details
-
getMaxConnectionPoolSize
Get the maximum number of live connections to keep in the pool.- Returns:
- the configured max number of live connections to keep in the pool.
-
setMaxConnectionPoolSize
Configures the maximum number of live connections to keep in the pool. If not configured, will be default to 1000.- Parameters:
maxConnectionPoolSize- the maximum number of live connections to keep in the pool. If null, the default value `1000` will be applied for http/2.- Returns:
- the current
Http2ConnectionConfig.
-
getMaxConcurrentStreams
Get the maximum number of the concurrent streams that can be opened to the remote peer.- Returns:
- the maximum number of the concurrent streams that can be opened to the remote peer.
-
setMaxConcurrentStreams
Configures the maximum number of the concurrent streams that can be opened to the remote peer. When evaluating how many streams can be opened to the remote peer, the minimum of this configuration and the remote peer configuration is taken (unless -1 is used). Default to 30.- Parameters:
maxConcurrentStreams- the maximum number of the concurrent streams that can be opened to the remote peer. If null, the default value `30` will be applied for http/2.- Returns:
- the current
Http2ConnectionConfig.
-
getMinConnectionPoolSize
Get the minimum number of live connections to keep in the pool (can be the best effort).- Returns:
- the minimum number of live connections to keep in the pool (can be the best effort).
-
setMinConnectionPoolSize
Configures the minimum number of live connections to keep in the pool (can be the best effort). Default to 1.- Parameters:
minConnectionPoolSize- the minimum number of live connections to keep in the pool (can be the best effort). If null, the default value `1` will be applied for http/2.- Returns:
- the current
Http2ConnectionConfig.
-
isEnabled
return the flag to indicate whether http2 is enabled.- Returns:
- the flag to indicate whether http2 is enabled.
-
setEnabled
Configure the flag to indicate whether http2 is enabled. If null, the default value (`false` while in preview, `true` later) will be applied for http/2.- Parameters:
enabled- the flag to indicate whether http2 is enabled.- Returns:
- the current
Http2ConnectionConfig.
-