CosmosClientOptions.MaxRetryAttemptsOnRateLimitedRequests Property


Gets or sets the maximum number of retries in the case where the request fails because the Azure Cosmos DB service has applied rate limiting on the client.

public int? MaxRetryAttemptsOnRateLimitedRequests { get; set; }
member this.MaxRetryAttemptsOnRateLimitedRequests : Nullable<int> with get, set
Public Property MaxRetryAttemptsOnRateLimitedRequests As Nullable(Of Integer)

Property Value


The default value is 9. This means in the case where the request is rate limited, the same request will be issued for a maximum of 10 times to the server before an error is returned to the application.

If the value of this property is set to 0, there will be no automatic retry on rate limiting requests from the client and the exception needs to be handled at the application level.


When a client is sending requests faster than the allowed rate, the service will return HttpStatusCode 429 (Too Many Requests) to rate limit the client. The current implementation in the SDK will then wait for the amount of time the service tells it to wait and retry after the time has elapsed.

For more information, see Handle rate limiting/request rate too large.

Applies to

See also