Class ExponentialErrorBackoffStrategy

  • All Implemented Interfaces:
    BackoffStrategy, ErrorAwareBackoffStrategy

    public class ExponentialErrorBackoffStrategy
    extends java.lang.Object
    implements ErrorAwareBackoffStrategy

    Provides an exponential backoff strategy when an error occurs fetching external tasks.

    Note this strategy does not provide any backoff when no external tasks are received. It should therefore only be used with long polling (asyncResponseTimeout) to ensure appropriate throttling of requests.

    • Field Detail

      • initTime

        protected long initTime
      • factor

        protected float factor
      • level

        protected int level
      • maxTime

        protected long maxTime
    • Constructor Detail

      • ExponentialErrorBackoffStrategy

        public ExponentialErrorBackoffStrategy()
      • ExponentialErrorBackoffStrategy

        public ExponentialErrorBackoffStrategy​(long initTime,
                                               float factor,
                                               long maxTime)
        Parameters:
        initTime - in milliseconds for which the client is suspended after the first request
        factor - is the base of the power by which the waiting time increases
        maxTime - in milliseconds for which the client can be suspended