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:
MessageProcessingException,Serializable
public class ListenerExecutionFailedException
extends RuntimeException
implements MessageProcessingException
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 booleanDeprecated.static <T> @Nullable Message<T>Deprecated.useMessageProcessingException.unwrapMessage(Throwable)instead.static <T> @Nullable Collection<Message<T>>Deprecated.useMessageProcessingException.unwrapMessages(Throwable)instead.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.- Specified by:
getFailedMessagesin interfaceMessageProcessingException- Returns:
- the messages.
-
unwrapMessage
Deprecated.useMessageProcessingException.unwrapMessage(Throwable)instead.Look for a potentially nestedMessageProcessingExceptionin the cause chain and if found return the wrappedMessageinstance.- Type Parameters:
T- the message type.- Parameters:
t- the throwable- Returns:
- the message.
-
unwrapMessages
Deprecated.useMessageProcessingException.unwrapMessages(Throwable)instead.Look for a potentially nestedMessageProcessingExceptionin the cause chain and if found return the wrappedMessageinstances.- Type Parameters:
T- the message type.- Parameters:
t- the throwable- Returns:
- the messages.
-
hasListenerException
Deprecated.Check whether aMessageProcessingExceptionis present anywhere in the cause chain oft.- Parameters:
t- the throwable.- Returns:
- whether a
MessageProcessingExceptionis present.
-
MessageProcessingException.hasProcessingException(Throwable)instead.