Class ExponentialBackoffBuilderImpl

    • Constructor Detail

      • ExponentialBackoffBuilderImpl

        public ExponentialBackoffBuilderImpl()
    • Method Detail

      • maxDelay

        public ExponentialBackoffBuilder maxDelay​(long maxDelay)
        Description copied from interface: ExponentialBackoffBuilder
        Sets the maximum retry delay.

        Note that the jitter may push the retry delay over this maximum.

        Default is 5000ms.

        Specified by:
        maxDelay in interface ExponentialBackoffBuilder
        Parameters:
        maxDelay - the maximum delay before retrying in ms
        Returns:
        the builder for this exponential backoff
      • minDelay

        public ExponentialBackoffBuilder minDelay​(long minDelay)
        Description copied from interface: ExponentialBackoffBuilder
        Sets the minimum retry delay.

        Note that the jitter may push the retry delay below this minimum.

        Default is 50ms.

        Specified by:
        minDelay in interface ExponentialBackoffBuilder
        Parameters:
        minDelay - the minimum delay before retrying is ms
        Returns:
        the builder for this exponential backoff
      • backoffFactor

        public ExponentialBackoffBuilder backoffFactor​(double backoffFactor)
        Description copied from interface: ExponentialBackoffBuilder
        Sets the backoff multiplication factor. The previous delay is multiplied by this factor. Default is 1.6.
        Specified by:
        backoffFactor in interface ExponentialBackoffBuilder
        Parameters:
        backoffFactor - the factor to multiply with the previous delay to determine the next delay
        Returns:
        the builder for this exponential backoff
      • jitterFactor

        public ExponentialBackoffBuilder jitterFactor​(double jitterFactor)
        Description copied from interface: ExponentialBackoffBuilder
        Sets the jitter factor. The next delay is changed randomly within a range of +/- this factor.

        For example, if the next delay is calculated to be 1s and the jitterFactor is 0.1 then the actual next delay can be somewhere between 0.9 and 1.1s.

        Default is 0.1

        Specified by:
        jitterFactor in interface ExponentialBackoffBuilder
        Parameters:
        jitterFactor - the range of possible jitter defined as a factor
        Returns:
        the builder for this exponential backoff