ExponentialBackoffRetryStrategy Class
- java.
lang. Object - com.
microsoft. bot. restclient. retry. RetryStrategy - com.
microsoft. bot. restclient. retry. ExponentialBackoffRetryStrategy
- com.
- com.
public final class ExponentialBackoffRetryStrategy
extends RetryStrategy
A retry strategy with backoff parameters for calculating the exponential delay between retries.
Field Summary
| Modifier and Type | Field and Description |
|---|---|
| static final int |
DEFAULT_CLIENT_BACKOFF
Represents the default amount of time used when calculating a random delta in the exponential delay between retries. |
| static final int |
DEFAULT_MAX_BACKOFF
Represents the default maximum amount of time used when calculating the exponential delay between retries. |
| static final int |
DEFAULT_MIN_BACKOFF
Represents the default minimum amount of time used when calculating the exponential delay between retries. |
Constructor Summary
| Constructor | Description |
|---|---|
| ExponentialBackoffRetryStrategy() |
Initializes a new instance of the ExponentialBackoffRetryStrategy class. |
| ExponentialBackoffRetryStrategy(int retryCount, int minBackoff, int maxBackoff, int deltaBackoff) |
Initializes a new instance of the ExponentialBackoffRetryStrategy class. |
| ExponentialBackoffRetryStrategy(String name, int retryCount, int minBackoff, int maxBackoff, int deltaBackoff, boolean firstFastRetry) |
Initializes a new instance of the ExponentialBackoffRetryStrategy class. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| boolean |
shouldRetry(int retryCount, Response response)
Returns if a request should be retried based on the retry count, current response, and the current strategy. |
Methods inherited from RetryStrategy
Methods inherited from java.lang.Object
Field Details
DEFAULT_CLIENT_BACKOFF
public static final int DEFAULT_CLIENT_BACKOFF
Represents the default amount of time used when calculating a random delta in the exponential delay between retries.
DEFAULT_MAX_BACKOFF
public static final int DEFAULT_MAX_BACKOFF
Represents the default maximum amount of time used when calculating the exponential delay between retries.
DEFAULT_MIN_BACKOFF
public static final int DEFAULT_MIN_BACKOFF
Represents the default minimum amount of time used when calculating the exponential delay between retries.
Constructor Details
ExponentialBackoffRetryStrategy
public ExponentialBackoffRetryStrategy()
Initializes a new instance of the ExponentialBackoffRetryStrategy class.
ExponentialBackoffRetryStrategy
public ExponentialBackoffRetryStrategy(int retryCount, int minBackoff, int maxBackoff, int deltaBackoff)
Initializes a new instance of the ExponentialBackoffRetryStrategy class.
Parameters:
ExponentialBackoffRetryStrategy
public ExponentialBackoffRetryStrategy(String name, int retryCount, int minBackoff, int maxBackoff, int deltaBackoff, boolean firstFastRetry)
Initializes a new instance of the ExponentialBackoffRetryStrategy class.
Parameters:
Method Details
shouldRetry
public boolean shouldRetry(int retryCount, Response response)
Returns if a request should be retried based on the retry count, current response, and the current strategy.
Overrides:
ExponentialBackoffRetryStrategy.shouldRetry(int retryCount, Response response)Parameters:
Returns: