Package io.awspring.cloud.sqs.listener
Interface MessageProcessingException
- All Known Implementing Classes:
InterceptorExecutionFailedException,ListenerExecutionFailedException
public interface MessageProcessingException
Implemented by exceptions that carry references to the
Message instances that failed during processing.
Provides static utility methods for traversing the cause chain and extracting message references.- Since:
- 4.1
- Author:
- Tomaz Fernandes
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCollection<Message<?>>Return the messages for which processing failed.static booleanCheck whether aMessageProcessingExceptionis present anywhere in the cause chain oft.static <T> @Nullable Message<T>unwrapMessage(@Nullable Throwable t) Look for a potentially nestedMessageProcessingExceptionin the cause chain and if found return the wrappedMessageinstance.static <T> @Nullable Collection<Message<T>>unwrapMessages(@Nullable Throwable t) Look for a potentially nestedMessageProcessingExceptionin the cause chain and if found return the wrappedMessageinstances.
-
Method Details
-
getFailedMessages
Collection<Message<?>> getFailedMessages()Return the messages for which processing failed.- Returns:
- the messages.
-
unwrapMessage
Look for a potentially nestedMessageProcessingExceptionin the cause chain and if found return the wrappedMessageinstance.- Type Parameters:
T- the message payload type.- Parameters:
t- the throwable- Returns:
- the message, or
nulliftisnull.
-
unwrapMessages
Look for a potentially nestedMessageProcessingExceptionin the cause chain and if found return the wrappedMessageinstances.- Type Parameters:
T- the message payload type.- Parameters:
t- the throwable- Returns:
- the messages, or
nulliftisnull.
-
hasProcessingException
Check whether aMessageProcessingExceptionis present anywhere in the cause chain oft.- Parameters:
t- the throwable.- Returns:
trueif aMessageProcessingExceptionis present.
-