Interface ErrorMessageStrategy

All Known Implementing Classes:
AmqpMessageHeaderErrorMessageStrategy, DefaultErrorMessageStrategy, JmsMessageHeaderErrorMessageStrategy, RawRecordHeaderErrorMessageStrategy
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ErrorMessageStrategy
A strategy to build an ErrorMessage based on the provided Throwable and AttributeAccessor as a context.

The Throwable payload is typically MessagingException which failedMessage property can be used to determine a cause of the error.

This strategy can be used for the ErrorMessageSendingRecoverer for RetryContext access.

Since:
4.3.10
Author:
Artem Bilan, Gary Russell
  • Method Details

    • buildErrorMessage

      ErrorMessage buildErrorMessage(Throwable payload, @Nullable AttributeAccessor attributes)
      Build the error message.
      Parameters:
      payload - the payload.
      attributes - the attributes.
      Returns:
      the ErrorMessage.