Permalink
Fetching contributors…
Cannot retrieve contributors at this time
508 lines (499 sloc) 31.4 KB
<Type Name="ConnectionPolicy" FullName="Microsoft.Azure.Documents.Client.ConnectionPolicy">
<TypeSignature Language="C#" Value="public sealed class ConnectionPolicy" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ConnectionPolicy extends System.Object" />
<TypeSignature Language="DocId" Value="T:Microsoft.Azure.Documents.Client.ConnectionPolicy" />
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>
Represents the connection policy associated with a DocumentClient to connect to the Azure DocumentDB database service.
</summary>
<remarks>To be added.</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ConnectionPolicy ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Azure.Documents.Client.ConnectionPolicy.#ctor" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Azure.Documents.Client.ConnectionPolicy" /> class to connect to the Azure DocumentDB database service.
</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ConnectionMode">
<MemberSignature Language="C#" Value="public Microsoft.Azure.Documents.Client.ConnectionMode ConnectionMode { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype Microsoft.Azure.Documents.Client.ConnectionMode ConnectionMode" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.ConnectionMode" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.Azure.Documents.Client.ConnectionMode</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets or sets the connection mode used by the client when connecting to the Azure DocumentDB database service.
</summary>
<value>
Default value is <see cref="F:Microsoft.Azure.Documents.Client.ConnectionMode.Gateway" /></value>
<remarks>
For more information, see <see href="https://docs.microsoft.com/en-us/azure/documentdb/documentdb-performance-tips#direct-connection">Connection policy: Use direct connection mode</see>.
</remarks>
</Docs>
</Member>
<Member MemberName="ConnectionProtocol">
<MemberSignature Language="C#" Value="public Microsoft.Azure.Documents.Client.Protocol ConnectionProtocol { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype Microsoft.Azure.Documents.Client.Protocol ConnectionProtocol" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.ConnectionProtocol" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.Azure.Documents.Client.Protocol</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets or sets the connection protocol when connecting to the Azure DocumentDB database service.
</summary>
<value>
Default value is <see cref="F:Microsoft.Azure.Documents.Client.Protocol.Https" />.
</value>
<remarks>
This setting is not used when <see cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.ConnectionMode" /> is set to <see cref="F:Microsoft.Azure.Documents.Client.ConnectionMode.Gateway" />.
Gateway mode only supports HTTPS.
For more information, see <see href="https://docs.microsoft.com/en-us/azure/documentdb/documentdb-performance-tips#use-tcp">Connection policy: Use the TCP protocol</see>.
</remarks>
</Docs>
</Member>
<Member MemberName="Default">
<MemberSignature Language="C#" Value="public static Microsoft.Azure.Documents.Client.ConnectionPolicy Default { get; }" />
<MemberSignature Language="ILAsm" Value=".property class Microsoft.Azure.Documents.Client.ConnectionPolicy Default" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.Default" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.Azure.Documents.Client.ConnectionPolicy</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets the default connection policy used to connect to the Azure DocumentDB database service.
</summary>
<value>
Refer to the default values for the individual properties of <see cref="T:Microsoft.Azure.Documents.Client.ConnectionPolicy" /> that determine the default connection policy.
</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="EnableEndpointDiscovery">
<MemberSignature Language="C#" Value="public bool EnableEndpointDiscovery { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool EnableEndpointDiscovery" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.EnableEndpointDiscovery" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets or sets the flag to enable endpoint discovery for geo-replicated database accounts in the Azure DocumentDB database service.
</summary>
<value>To be added.</value>
<remarks>
When the value of this property is true, the SDK will automatically discover the
current write and read regions to ensure requests are sent to the correct region
based on the regions specified in the <see cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.PreferredLocations" /> property.
<value>Default value is true indicating endpoint discovery is enabled.</value></remarks>
</Docs>
</Member>
<Member MemberName="MaxConnectionLimit">
<MemberSignature Language="C#" Value="public int MaxConnectionLimit { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 MaxConnectionLimit" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.MaxConnectionLimit" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets or sets the maximum number of concurrent connections allowed for the target
service endpoint in the Azure DocumentDB database service.
</summary>
<value>Default value is 50.</value>
<remarks>
This setting is only applicable in Gateway mode.
</remarks>
</Docs>
</Member>
<Member MemberName="MediaReadMode">
<MemberSignature Language="C#" Value="public Microsoft.Azure.Documents.Client.MediaReadMode MediaReadMode { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype Microsoft.Azure.Documents.Client.MediaReadMode MediaReadMode" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.MediaReadMode" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.Azure.Documents.Client.MediaReadMode</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets or sets the attachment content (a.k.a. media) download mode when connecting to the Azure DocumentDB database service.
</summary>
<value>
Default value is <see cref="F:Microsoft.Azure.Documents.Client.MediaReadMode.Buffered" />.
</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="MediaRequestTimeout">
<MemberSignature Language="C#" Value="public TimeSpan MediaRequestTimeout { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.TimeSpan MediaRequestTimeout" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.MediaRequestTimeout" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.TimeSpan</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets or sets the media request timeout in seconds when connecting to the Azure DocumentDB database service.
The number specifies the time to wait for response to come back from network peer for attachment content (a.k.a. media) operations.
</summary>
<value>
Default value is 300 seconds.
</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="PreferredLocations">
<MemberSignature Language="C#" Value="public System.Collections.ObjectModel.Collection&lt;string&gt; PreferredLocations { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Collections.ObjectModel.Collection`1&lt;string&gt; PreferredLocations" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.PreferredLocations" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.ObjectModel.Collection&lt;System.String&gt;</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets and sets the preferred locations (regions) for geo-replicated database accounts in the Azure DocumentDB database service.
For example, "East US" as the preferred location.
</summary>
<value>To be added.</value>
<remarks>
<para>
When <see cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.EnableEndpointDiscovery" /> is true and the value of this property is non-empty,
the SDK uses the locations in the collection in the order they are specified to perform operations,
otherwise if the value of this property is not specified,
the SDK uses the write region as the preferred location for all operations.
</para>
<para>
If <see cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.EnableEndpointDiscovery" /> is set to false, the value of this property is ignored.
</para>
</remarks>
</Docs>
</Member>
<Member MemberName="RequestTimeout">
<MemberSignature Language="C#" Value="public TimeSpan RequestTimeout { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.TimeSpan RequestTimeout" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.RequestTimeout" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.TimeSpan</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets or sets the request timeout in seconds when connecting to the Azure DocumentDB database service.
The number specifies the time to wait for response to come back from network peer.
</summary>
<value>Default value is 60 seconds.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="RetryOptions">
<MemberSignature Language="C#" Value="public Microsoft.Azure.Documents.Client.RetryOptions RetryOptions { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class Microsoft.Azure.Documents.Client.RetryOptions RetryOptions" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.RetryOptions" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.Azure.Documents.Client.RetryOptions</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets or sets the <see cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.RetryOptions" /> associated
with the <see cref="T:Microsoft.Azure.Documents.Client.DocumentClient" /> in the Azure DocumentDB database service.
</summary>
<value>
If this property is not set, the SDK uses the default retry policy that has <see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryAttemptsOnThrottledRequests" />
set to 9 and <see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryWaitTimeInSeconds" /> set to 30 seconds.
</value>
<remarks>
For more information, see <see href="https://docs.microsoft.com/en-us/azure/documentdb/documentdb-performance-tips#429">Handle rate limiting/request rate too large</see>.
</remarks>
<altmember cref="T:Microsoft.Azure.Documents.Client.DocumentClient" />
<altmember cref="T:Microsoft.Azure.Documents.Client.ConnectionPolicy" />
<altmember cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.RetryOptions" />
<example>
The example below creates a new <see cref="T:Microsoft.Azure.Documents.Client.DocumentClient" /> and sets the <see cref="T:Microsoft.Azure.Documents.Client.ConnectionPolicy" />
using the <see cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.RetryOptions" /> property.
<para><see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryAttemptsOnThrottledRequests" /> is set to 3, so in this case, if a request operation is rate limited by exceeding the reserved
throughput for the collection, the request operation retries 3 times before throwing the exception to the application.
<see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryWaitTimeInSeconds" /> is set to 60, so in this case if the cumulative retry
wait time in seconds since the first request exceeds 60 seconds, the exception is thrown.
</para><code language="c#"><![CDATA[
ConnectionPolicy connectionPolicy = new ConnectionPolicy();
connectionPolicy.RetryOptions.MaxRetryAttemptsOnThrottledRequests = 3;
connectionPolicy.RetryOptions.MaxRetryWaitTimeInSeconds = 60;
DocumentClient client = new DocumentClient(new Uri("service endpoint"), "auth key", connectionPolicy);
]]></code></example>
<example>
The example below creates a new <see cref="T:Microsoft.Azure.Documents.Client.DocumentClient" /> and sets the <see cref="T:Microsoft.Azure.Documents.Client.ConnectionPolicy" />
using the <see cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.RetryOptions" /> property.
<para><see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryAttemptsOnThrottledRequests" /> is set to 3, so in this case, if a request operation is rate limited by exceeding the reserved
throughput for the collection, the request operation retries 3 times before throwing the exception to the application.
<see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryWaitTimeInSeconds" /> is set to 60, so in this case if the cumulative retry
wait time in seconds since the first request exceeds 60 seconds, the exception is thrown.
</para><code language="c#"><![CDATA[
ConnectionPolicy connectionPolicy = new ConnectionPolicy();
connectionPolicy.RetryOptions.MaxRetryAttemptsOnThrottledRequests = 3;
connectionPolicy.RetryOptions.MaxRetryWaitTimeInSeconds = 60;
DocumentClient client = new DocumentClient(new Uri("service endpoint"), "auth key", connectionPolicy);
]]></code></example>
<example>
The example below creates a new <see cref="T:Microsoft.Azure.Documents.Client.DocumentClient" /> and sets the <see cref="T:Microsoft.Azure.Documents.Client.ConnectionPolicy" />
using the <see cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.RetryOptions" /> property.
<para><see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryAttemptsOnThrottledRequests" /> is set to 3, so in this case, if a request operation is rate limited by exceeding the reserved
throughput for the collection, the request operation retries 3 times before throwing the exception to the application.
<see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryWaitTimeInSeconds" /> is set to 60, so in this case if the cumulative retry
wait time in seconds since the first request exceeds 60 seconds, the exception is thrown.
</para><code language="c#"><![CDATA[
ConnectionPolicy connectionPolicy = new ConnectionPolicy();
connectionPolicy.RetryOptions.MaxRetryAttemptsOnThrottledRequests = 3;
connectionPolicy.RetryOptions.MaxRetryWaitTimeInSeconds = 60;
DocumentClient client = new DocumentClient(new Uri("service endpoint"), "auth key", connectionPolicy);
]]></code></example>
<example>
The example below creates a new <see cref="T:Microsoft.Azure.Documents.Client.DocumentClient" /> and sets the <see cref="T:Microsoft.Azure.Documents.Client.ConnectionPolicy" />
using the <see cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.RetryOptions" /> property.
<para><see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryAttemptsOnThrottledRequests" /> is set to 3, so in this case, if a request operation is rate limited by exceeding the reserved
throughput for the collection, the request operation retries 3 times before throwing the exception to the application.
<see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryWaitTimeInSeconds" /> is set to 60, so in this case if the cumulative retry
wait time in seconds since the first request exceeds 60 seconds, the exception is thrown.
</para><code language="c#"><![CDATA[
ConnectionPolicy connectionPolicy = new ConnectionPolicy();
connectionPolicy.RetryOptions.MaxRetryAttemptsOnThrottledRequests = 3;
connectionPolicy.RetryOptions.MaxRetryWaitTimeInSeconds = 60;
DocumentClient client = new DocumentClient(new Uri("service endpoint"), "auth key", connectionPolicy);
]]></code></example>
<example>
The example below creates a new <see cref="T:Microsoft.Azure.Documents.Client.DocumentClient" /> and sets the <see cref="T:Microsoft.Azure.Documents.Client.ConnectionPolicy" />
using the <see cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.RetryOptions" /> property.
<para><see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryAttemptsOnThrottledRequests" /> is set to 3, so in this case, if a request operation is rate limited by exceeding the reserved
throughput for the collection, the request operation retries 3 times before throwing the exception to the application.
<see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryWaitTimeInSeconds" /> is set to 60, so in this case if the cumulative retry
wait time in seconds since the first request exceeds 60 seconds, the exception is thrown.
</para><code language="c#"><![CDATA[
ConnectionPolicy connectionPolicy = new ConnectionPolicy();
connectionPolicy.RetryOptions.MaxRetryAttemptsOnThrottledRequests = 3;
connectionPolicy.RetryOptions.MaxRetryWaitTimeInSeconds = 60;
DocumentClient client = new DocumentClient(new Uri("service endpoint"), "auth key", connectionPolicy);
]]></code></example>
<example>
The example below creates a new <see cref="T:Microsoft.Azure.Documents.Client.DocumentClient" /> and sets the <see cref="T:Microsoft.Azure.Documents.Client.ConnectionPolicy" />
using the <see cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.RetryOptions" /> property.
<para><see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryAttemptsOnThrottledRequests" /> is set to 3, so in this case, if a request operation is rate limited by exceeding the reserved
throughput for the collection, the request operation retries 3 times before throwing the exception to the application.
<see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryWaitTimeInSeconds" /> is set to 60, so in this case if the cumulative retry
wait time in seconds since the first request exceeds 60 seconds, the exception is thrown.
</para><code language="c#"><![CDATA[
ConnectionPolicy connectionPolicy = new ConnectionPolicy();
connectionPolicy.RetryOptions.MaxRetryAttemptsOnThrottledRequests = 3;
connectionPolicy.RetryOptions.MaxRetryWaitTimeInSeconds = 60;
DocumentClient client = new DocumentClient(new Uri("service endpoint"), "auth key", connectionPolicy);
]]></code></example>
<example>
The example below creates a new <see cref="T:Microsoft.Azure.Documents.Client.DocumentClient" /> and sets the <see cref="T:Microsoft.Azure.Documents.Client.ConnectionPolicy" />
using the <see cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.RetryOptions" /> property.
<para><see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryAttemptsOnThrottledRequests" /> is set to 3, so in this case, if a request operation is rate limited by exceeding the reserved
throughput for the collection, the request operation retries 3 times before throwing the exception to the application.
<see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryWaitTimeInSeconds" /> is set to 60, so in this case if the cumulative retry
wait time in seconds since the first request exceeds 60 seconds, the exception is thrown.
</para><code language="c#"><![CDATA[
ConnectionPolicy connectionPolicy = new ConnectionPolicy();
connectionPolicy.RetryOptions.MaxRetryAttemptsOnThrottledRequests = 3;
connectionPolicy.RetryOptions.MaxRetryWaitTimeInSeconds = 60;
DocumentClient client = new DocumentClient(new Uri("service endpoint"), "auth key", connectionPolicy);
]]></code></example>
<example>
The example below creates a new <see cref="T:Microsoft.Azure.Documents.Client.DocumentClient" /> and sets the <see cref="T:Microsoft.Azure.Documents.Client.ConnectionPolicy" />
using the <see cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.RetryOptions" /> property.
<para><see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryAttemptsOnThrottledRequests" /> is set to 3, so in this case, if a request operation is rate limited by exceeding the reserved
throughput for the collection, the request operation retries 3 times before throwing the exception to the application.
<see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryWaitTimeInSeconds" /> is set to 60, so in this case if the cumulative retry
wait time in seconds since the first request exceeds 60 seconds, the exception is thrown.
</para><code language="c#"><![CDATA[
ConnectionPolicy connectionPolicy = new ConnectionPolicy();
connectionPolicy.RetryOptions.MaxRetryAttemptsOnThrottledRequests = 3;
connectionPolicy.RetryOptions.MaxRetryWaitTimeInSeconds = 60;
DocumentClient client = new DocumentClient(new Uri("service endpoint"), "auth key", connectionPolicy);
]]></code></example>
<example>
The example below creates a new <see cref="T:Microsoft.Azure.Documents.Client.DocumentClient" /> and sets the <see cref="T:Microsoft.Azure.Documents.Client.ConnectionPolicy" />
using the <see cref="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.RetryOptions" /> property.
<para><see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryAttemptsOnThrottledRequests" /> is set to 3, so in this case, if a request operation is rate limited by exceeding the reserved
throughput for the collection, the request operation retries 3 times before throwing the exception to the application.
<see cref="P:Microsoft.Azure.Documents.Client.RetryOptions.MaxRetryWaitTimeInSeconds" /> is set to 60, so in this case if the cumulative retry
wait time in seconds since the first request exceeds 60 seconds, the exception is thrown.
</para><code language="c#"><![CDATA[
ConnectionPolicy connectionPolicy = new ConnectionPolicy();
connectionPolicy.RetryOptions.MaxRetryAttemptsOnThrottledRequests = 3;
connectionPolicy.RetryOptions.MaxRetryWaitTimeInSeconds = 60;
DocumentClient client = new DocumentClient(new Uri("service endpoint"), "auth key", connectionPolicy);
]]></code></example>
</Docs>
</Member>
<Member MemberName="UserAgentSuffix">
<MemberSignature Language="C#" Value="public string UserAgentSuffix { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string UserAgentSuffix" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Client.ConnectionPolicy.UserAgentSuffix" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>
A suffix to be added to the default user-agent for the Azure DocumentDB database service.
</summary>
<value>To be added.</value>
<remarks>
Setting this property after sending any request won't have any effect.
</remarks>
</Docs>
</Member>
</Members>
</Type>