Interface ErrorAwareBackoffStrategy

  • All Superinterfaces:
    BackoffStrategy
    All Known Implementing Classes:
    ExponentialErrorBackoffStrategy

    public interface ErrorAwareBackoffStrategy
    extends BackoffStrategy

    Provides a way to define a back off between fetch and lock requests.

    Note: Since an implementation of this interface may be executed by multiple threads, it is recommended to implement the custom backoff strategy in a thread-safe manner.

    • Method Detail

      • reconfigure

        default void reconfigure​(java.util.List<ExternalTask> externalTasks)
        This is to provide compatibility with existing BackoffStrategy configurations. Do not override. Implementations of ErrorAwareBackoffStrategy should override reconfigure(List, Exception) instead.
        Specified by:
        reconfigure in interface BackoffStrategy
        Parameters:
        externalTasks - which have been fetched
      • reconfigure

        void reconfigure​(java.util.List<ExternalTask> externalTasks,
                         java.lang.Exception e)

        Reconfigures the back off strategy based on the fetched external tasks and any error that might have occurred. It is invoked before calculateBackoffTime().

        The implementation might count the amount of invocations and realize a strategy reset.

        Parameters:
        externalTasks - which have been fetched