Class RetryExponential


  • public final class RetryExponential
    extends RetryPolicy
    RetryPolicy implementation where the delay between retries will grow in an exponential manner. RetryPolicy can be set on the client operations using ConnectionStringBuilder. RetryIntervals will be computed using a retryFactor which is a function of deltaBackOff (MaximumBackoff - MinimumBackoff) and MaximumRetryCount
    Since:
    1.0
    • Constructor Detail

      • RetryExponential

        public RetryExponential​(Duration minimumBackoff,
                                Duration maximumBackoff,
                                int maximumRetryCount,
                                String name)
    • Method Detail

      • onGetNextRetryInterval

        protected Duration onGetNextRetryInterval​(String clientId,
                                                  Exception lastException,
                                                  Duration remainingTime,
                                                  int baseWaitTimeSecs)
        Description copied from class: RetryPolicy
        Adjusts the interval after which nextRetry should be attempted, based on the last exception encountered, the remaining time before the operation times out and the minimum wait time before retry. Clients can override this method to specify a wait time based on the exception encountered.
        Specified by:
        onGetNextRetryInterval in class RetryPolicy
        Parameters:
        clientId - id of the sender or receiver or client object that encountered the exception.
        lastException - last exception encountered
        remainingTime - remainingTime to retry before the operation times out
        baseWaitTimeSecs - minimum wait time determined by the base retry policy. Overriding methods can return a different value.
        Returns:
        duration after which the operation will be retried. Returns null when the operation should not retried