Package io.awspring.cloud.sqs.listener
Class ListenerExecutionFailedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.awspring.cloud.sqs.listener.ListenerExecutionFailedException
- All Implemented Interfaces:
Serializable
Exception thrown when the
AsyncMessageListener completes with an exception. Contains the Message
instance or instances which execution failed, as well as some convenience methods for handling such messages.- Since:
- 3.0
- Author:
- Tomaz Fernandes
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionListenerExecutionFailedException(String message, Throwable cause, Collection<Message<T>> failedMessages) ListenerExecutionFailedException(String message, Throwable cause, Message<?> failedMessage) -
Method Summary
Modifier and TypeMethodDescriptionMessage<?>Return the message which listener execution failed.Collection<Message<?>>Return the messages which listener execution failed.static booleanstatic <T> Message<T>Look for a potentially nestedListenerExecutionFailedExceptionand if found return the wrappedMessageinstance.static <T> Collection<Message<T>>Look for a potentially nestedListenerExecutionFailedExceptionand if found return the wrappedMessageinstances.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ListenerExecutionFailedException
-
ListenerExecutionFailedException
public ListenerExecutionFailedException(String message, Throwable cause, Collection<Message<T>> failedMessages)
-
-
Method Details
-
getFailedMessage
Return the message which listener execution failed.- Returns:
- the message.
-
getFailedMessages
Return the messages which listener execution failed.- Returns:
- the messages.
-
unwrapMessage
Look for a potentially nestedListenerExecutionFailedExceptionand if found return the wrappedMessageinstance.- Type Parameters:
T- the message type.- Parameters:
t- the throwable- Returns:
- the message.
-
unwrapMessages
Look for a potentially nestedListenerExecutionFailedExceptionand if found return the wrappedMessageinstances.- Type Parameters:
T- the message type.- Parameters:
t- the throwable- Returns:
- the messages.
-
hasListenerException
-