Share via


ConnectionPolicy Class

Definition

Represents the connection policy associated with a DocumentClient to connect to the Azure Cosmos DB service.

public sealed class ConnectionPolicy
type ConnectionPolicy = class
Public NotInheritable Class ConnectionPolicy
Inheritance
ConnectionPolicy

Constructors

ConnectionPolicy()

Initializes a new instance of the ConnectionPolicy class to connect to the Azure Cosmos DB service.

Properties

ConnectionMode

Gets or sets the connection mode used by the client when connecting to the Azure Cosmos DB service.

ConnectionProtocol

Gets or sets the connection protocol when connecting to the Azure Cosmos DB service.

Default

Gets the default connection policy used to connect to the Azure Cosmos DB service.

EnableEndpointDiscovery

Gets or sets the flag to enable endpoint discovery for geo-replicated database accounts in the Azure Cosmos DB service.

EnableReadRequestsFallback

Gets or sets whether to allow for reads to go to multiple regions configured on an account of Azure Cosmos DB service.

EnableTcpConnectionEndpointRediscovery

Gets or sets the flag to enable address cache refresh on connection reset notification

IdleTcpConnectionTimeout

(Direct/TCP) Controls the amount of idle time after which unused connections are closed.

MaxConnectionLimit

Gets or sets the maximum number of concurrent connections allowed for the target service endpoint in the Azure Cosmos DB service.

MaxRequestsPerTcpConnection

(Direct/TCP) Controls the number of requests allowed simultaneously over a single TCP connection. When more requests are in flight simultaneously, the direct/TCP client will open additional connections.

MaxTcpConnectionsPerEndpoint

(Direct/TCP) Controls the maximum number of TCP connections that may be opened to each Cosmos DB back-end. Together with MaxRequestsPerTcpConnection, this setting limits the number of requests that are simultaneously sent to a single Cosmos DB back-end(MaxRequestsPerTcpConnection x MaxTcpConnectionPerEndpoint).

MediaReadMode

Gets or sets the attachment content (a.k.a. media) download mode when connecting to the Azure Cosmos DB service.

MediaRequestTimeout

Gets or sets the media request timeout in seconds when connecting to the Azure Cosmos DB service. The number specifies the time to wait for response to come back from network peer for attachment content (a.k.a. media) operations.

OpenTcpConnectionTimeout

(Direct/TCP) Controls the amount of time allowed for trying to establish a connection.

PortReuseMode

(Direct/TCP) Controls the client port reuse policy used by the transport stack.

PreferredLocations

Gets and sets the preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. For example, "East US" as the preferred location.

QueryPlanGenerationMode

Gets or sets a flag for query execution to control how the SDK instance will get the query plan. The ServiceInterop only works on Windows with application running in x64 and it allows the SDK to generate the query plan locally

RequestTimeout

Gets or sets the request timeout in seconds when connecting to the Azure Cosmos DB service. The number specifies the time to wait for response to come back from network peer.

RetryOptions

Gets or sets the RetryOptions associated with the DocumentClient in the Azure Cosmos DB service.

UseMultipleWriteLocations

Gets or sets the flag to enable writes on any locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service.

UserAgentSuffix

A suffix to be added to the default user-agent for the Azure Cosmos DB service.

Methods

SetCurrentLocation(String)

Automatically populates the PreferredLocations for geo-replicated database accounts in the Azure Cosmos DB service, based on the current region that the client is running in.

Applies to