ExponentialBackoff Class

  • java.lang.Object
    • RetryStrategy
      • com.microsoft.azure.elasticdb.core.commons.transientfaulthandling.ExponentialBackoff

public class ExponentialBackoff extends RetryStrategy

A retry strategy with backoff parameters for calculating the exponential delay between retries.

Constructor Summary

Constructor Description
ExponentialBackoff()

Initializes a new instance of the ExponentialBackoff class.

ExponentialBackoff(int retryCount, Duration minBackoff, Duration maxBackoff, Duration deltaBackoff)

Initializes a new instance of the ExponentialBackoff class with the specified retry settings.

ExponentialBackoff(String name, int retryCount, Duration minBackoff, Duration maxBackoff, Duration deltaBackoff)

Initializes a new instance of the ExponentialBackoff class with the specified name and retry settings.

ExponentialBackoff(String name, int retryCount, Duration minBackoff, Duration maxBackoff, Duration deltaBackoff, boolean firstFastRetry)

Initializes a new instance of the ExponentialBackoff class with the specified name, retry settings, and fast retry option.

Method Summary

Modifier and Type Method and Description
ShouldRetry getShouldRetry()

Returns the corresponding ShouldRetry delegate.

Inherited Members

Constructor Details

ExponentialBackoff

public ExponentialBackoff()

Initializes a new instance of the ExponentialBackoff class.

ExponentialBackoff

public ExponentialBackoff(int retryCount, Duration minBackoff, Duration maxBackoff, Duration deltaBackoff)

Initializes a new instance of the ExponentialBackoff class with the specified retry settings.

Parameters:

retryCount - The maximum number of retry attempts.
minBackoff - The minimum backoff time
maxBackoff - The maximum backoff time.
deltaBackoff - The value that will be used to calculate a random delta in the exponential delay between retries.

ExponentialBackoff

public ExponentialBackoff(String name, int retryCount, Duration minBackoff, Duration maxBackoff, Duration deltaBackoff)

Initializes a new instance of the ExponentialBackoff class with the specified name and retry settings.

Parameters:

name - The name of the retry strategy.
retryCount - The maximum number of retry attempts.
minBackoff - The minimum backoff time
maxBackoff - The maximum backoff time.
deltaBackoff - The value that will be used to calculate a random delta in the exponential delay between retries.

ExponentialBackoff

public ExponentialBackoff(String name, int retryCount, Duration minBackoff, Duration maxBackoff, Duration deltaBackoff, boolean firstFastRetry)

Initializes a new instance of the ExponentialBackoff class with the specified name, retry settings, and fast retry option.

Parameters:

name - The name of the retry strategy.
retryCount - The maximum number of retry attempts.
minBackoff - The minimum backoff time
maxBackoff - The maximum backoff time.
deltaBackoff - The value that will be used to calculate a random delta in the exponential delay between retries.
firstFastRetry - true to immediately retry in the first attempt; otherwise, false. The subsequent retries will remain subject to the configured retry interval.

Method Details

getShouldRetry

public ShouldRetry getShouldRetry()

Returns the corresponding ShouldRetry delegate.

Returns:

The ShouldRetry delegate.

Applies to