public class ExponentialBackoffPolicyforMSI extends Object implements RetryPolicy
Constructor and Description |
---|
ExponentialBackoffPolicyforMSI() |
ExponentialBackoffPolicyforMSI(int maxRetries,
int exponentialRetryInterval,
int exponentialFactor)
Implements Exponential backoff policy, with error condition checks specific to MSI
|
Modifier and Type | Method and Description |
---|---|
boolean |
shouldRetry(int httpResponseCode,
Exception lastException)
boolean indicating whether a failed request should be retried.
|
public ExponentialBackoffPolicyforMSI()
public ExponentialBackoffPolicyforMSI(int maxRetries, int exponentialRetryInterval, int exponentialFactor)
maxRetries
- maximum number of retriesexponentialRetryInterval
- (starting) interval to use for exponential backoff retries (in milliseconds)exponentialFactor
- factor to multiply the retry interval bypublic boolean shouldRetry(int httpResponseCode, Exception lastException)
RetryPolicy
If the retry policy requires a wait before the next try, then the shouldRetry
method should wait for
the appropriate time before responding back. i.e., there is not an explicit contract for waits, but it
is implicit in the time taken by the shouldRetry
method to return.
shouldRetry
in interface RetryPolicy
httpResponseCode
- the HTTP response code receivedlastException
- any exceptions encountered while processing the last requestCopyright © 2019 Microsoft Corporation. All rights reserved.