Interface TaskExecutionBackOff

All Known Implementing Classes:
ExponentialTaskExecutionBackOff, FixedTaskExecutionBackOff

public interface TaskExecutionBackOff
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    Return value of nextBackOff(Object, RqueueMessage, int) that indicates that the task should not be retried further.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    nextBackOff(Object message, RqueueMessage rqueueMessage, int failureCount)
    Return the number of milliseconds to wait for the same message to be consumed.
    default long
    nextBackOff(Object message, RqueueMessage rqueueMessage, int failureCount, Throwable throwable)
    Return the number of milliseconds to wait for the same message to be consumed.
  • Field Details

  • Method Details

    • nextBackOff

      long nextBackOff(Object message, RqueueMessage rqueueMessage, int failureCount)
      Return the number of milliseconds to wait for the same message to be consumed.

      Return -1L to indicate that no further enqueue should be made for the message.

      Parameters:
      message - message that's fetched
      rqueueMessage - raw message
      failureCount - number of times this message has failed.
      Returns:
      backoff in the millisecond.
    • nextBackOff

      default long nextBackOff(Object message, RqueueMessage rqueueMessage, int failureCount, Throwable throwable)
      Return the number of milliseconds to wait for the same message to be consumed.

      Return -1L to indicate message should be moved to DLQ if DLQ is set

      Parameters:
      message - message that's fetched
      rqueueMessage - raw message
      failureCount - number of times this message has failed.
      throwable - the exception that has occurred
      Returns:
      backoff in the millisecond.