Interface TaskExecutionBackOff
- All Known Implementing Classes:
ExponentialTaskExecutionBackOff,FixedTaskExecutionBackOff
public interface TaskExecutionBackOff
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longReturn value ofnextBackOff(Object, RqueueMessage, int)that indicates that the task should not be retried further. -
Method Summary
Modifier and TypeMethodDescriptionlongnextBackOff(Object message, RqueueMessage rqueueMessage, int failureCount) Return the number of milliseconds to wait for the same message to be consumed.default longnextBackOff(Object message, RqueueMessage rqueueMessage, int failureCount, Throwable throwable) Return the number of milliseconds to wait for the same message to be consumed.
-
Field Details
-
STOP
static final long STOPReturn value ofnextBackOff(Object, RqueueMessage, int)that indicates that the task should not be retried further.- See Also:
-
-
Method Details
-
nextBackOff
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 fetchedrqueueMessage- raw messagefailureCount- 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 fetchedrqueueMessage- raw messagefailureCount- number of times this message has failed.throwable- the exception that has occurred- Returns:
- backoff in the millisecond.
-