Share via


Http2ConnectionConfig Class

  • java.lang.Object
    • com.azure.cosmos.Http2ConnectionConfig

public class Http2ConnectionConfig

Represents the http2 connection config associated with Cosmos Client in the Azure Cosmos DB database service.

Constructor Summary

Constructor Description
Http2ConnectionConfig()

The constructor of Http2ConnectionConfig.

Method Summary

Modifier and Type Method and Description
Integer getMaxConcurrentStreams()

Get the maximum number of the concurrent streams that can be opened to the remote peer.

Integer getMaxConnectionPoolSize()

Get the maximum number of live connections to keep in the pool.

Integer getMinConnectionPoolSize()

Get the minimum number of live connections to keep in the pool (can be the best effort).

Boolean isEnabled()

return the flag to indicate whether http2 is enabled.

Http2ConnectionConfig setEnabled(Boolean enabled)

Configure the flag to indicate whether http2 is enabled.

Http2ConnectionConfig setMaxConcurrentStreams(Integer maxConcurrentStreams)

Configures the maximum number of the concurrent streams that can be opened to the remote peer.

Http2ConnectionConfig setMaxConnectionPoolSize(Integer maxConnectionPoolSize)

Configures the maximum number of live connections to keep in the pool.

Http2ConnectionConfig setMinConnectionPoolSize(Integer minConnectionPoolSize)

Configures the minimum number of live connections to keep in the pool (can be the best effort).

Methods inherited from java.lang.Object

Constructor Details

Http2ConnectionConfig

public Http2ConnectionConfig()

The constructor of Http2ConnectionConfig.

Method Details

getMaxConcurrentStreams

public Integer 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.

getMaxConnectionPoolSize

public Integer 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.

getMinConnectionPoolSize

public Integer 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).

isEnabled

public Boolean isEnabled()

return the flag to indicate whether http2 is enabled.

Returns:

the flag to indicate whether http2 is enabled.

setEnabled

public Http2ConnectionConfig setEnabled(Boolean enabled)

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:

setMaxConcurrentStreams

public Http2ConnectionConfig setMaxConcurrentStreams(Integer maxConcurrentStreams)

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:

setMaxConnectionPoolSize

public Http2ConnectionConfig setMaxConnectionPoolSize(Integer maxConnectionPoolSize)

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:

setMinConnectionPoolSize

public Http2ConnectionConfig setMinConnectionPoolSize(Integer minConnectionPoolSize)

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:

Applies to