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 Details

    • getFailedMessages

      Collection<Message<?>> getFailedMessages()
      Return the messages for which processing failed.
      Returns:
      the messages.
    • unwrapMessage

      static <T> @Nullable Message<T> unwrapMessage(@Nullable Throwable t)
      Look for a potentially nested MessageProcessingException in the cause chain and if found return the wrapped Message instance.
      Type Parameters:
      T - the message payload type.
      Parameters:
      t - the throwable
      Returns:
      the message, or null if t is null.
    • unwrapMessages

      static <T> @Nullable Collection<Message<T>> unwrapMessages(@Nullable Throwable t)
      Look for a potentially nested MessageProcessingException in the cause chain and if found return the wrapped Message instances.
      Type Parameters:
      T - the message payload type.
      Parameters:
      t - the throwable
      Returns:
      the messages, or null if t is null.
    • hasProcessingException

      static boolean hasProcessingException(Throwable t)
      Check whether a MessageProcessingException is present anywhere in the cause chain of t.
      Parameters:
      t - the throwable.
      Returns:
      true if a MessageProcessingException is present.