Class ExponentialBackoffErrorHandler<T>
java.lang.Object
io.awspring.cloud.sqs.listener.errorhandler.ExponentialBackoffErrorHandler<T>
- All Implemented Interfaces:
AsyncErrorHandler<T>
An implementation of an Exponential Backoff error handler for asynchronous message processing.
This error handler sets the SQS message visibility timeout exponentially based on the number of received attempts whenever an exception occurs.
When AcknowledgementMode is set to ON_SUCCESS (the default), returning a failed future prevents the message from being acknowledged.
- Author:
- Bruno Garcia, Rafael Pavarini
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ExponentialBackoffErrorHandler.Builder<T>builder()handle(Collection<Message<T>> messages, Throwable t) Asynchronously handle the errors thrown processing the givenMessageinstances.Asynchronously handle the errors thrown processing the givenMessage.
-
Method Details
-
handle
Description copied from interface:AsyncErrorHandlerAsynchronously handle the errors thrown processing the givenMessage.- Specified by:
handlein interfaceAsyncErrorHandler<T>- Parameters:
message- the message.t- the thrown exception.- Returns:
- a completable future.
-
handle
Description copied from interface:AsyncErrorHandlerAsynchronously handle the errors thrown processing the givenMessageinstances.- Specified by:
handlein interfaceAsyncErrorHandler<T>- Parameters:
messages- the messages.t- the thrown exception.- Returns:
- a completable future.
-
builder
-