Interface ErrorMessageStrategy
- All Known Implementing Classes:
DefaultErrorMessageStrategy
- 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
-
Method Summary
Modifier and Type Method Description org.springframework.messaging.support.ErrorMessage
buildErrorMessage(java.lang.Throwable payload, org.springframework.core.AttributeAccessor attributes)
Build the error message.
-
Method Details
-
buildErrorMessage
org.springframework.messaging.support.ErrorMessage buildErrorMessage(java.lang.Throwable payload, @Nullable org.springframework.core.AttributeAccessor attributes)Build the error message.- Parameters:
payload
- the payload.attributes
- the attributes.- Returns:
- the ErrorMessage.
-