Condividi tramite


RetryOptions.MaxRetryAttemptsOnThrottledRequests Property

Definition

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 MaxRetryAttemptsOnThrottledRequests { get; set; }
member this.MaxRetryAttemptsOnThrottledRequests : int with get, set
Public Property MaxRetryAttemptsOnThrottledRequests As 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 handled at the application level. For an example on how to set this value, please refer to RetryOptions.

Remarks

When a client is sending requests faster than the allowed rate, the service will return HttpStatusCode 429 (Too Many Request) 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