Class ErrorMessage
- All Implemented Interfaces:
- Serializable,- Message<Throwable>
GenericMessage with a Throwable payload.
 The payload is typically a MessagingException
 with the message at the point of failure in its failedMessage property.
 An optional originalMessage may be provided, which represents the message
 that existed at the point in the stack where the error message is created.
 
Consider some code that starts with a message, invokes some process that performs transformation on that message and then fails for some reason, throwing the exception. The exception is caught and an error message produced that contains both the original message, and the transformed message that failed.
- Since:
- 4.0
- Author:
- Mark Fisher, Oleg Zhurakousky, Gary Russell
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionErrorMessage(Throwable payload) Create a new message with the given payload.ErrorMessage(Throwable payload, Map<String, Object> headers) Create a new message with the given payload and headers.Create a new message with the given payload, headers and original message.ErrorMessage(Throwable payload, Message<?> originalMessage) Create a new message with the given payload and original message.ErrorMessage(Throwable payload, MessageHeaders headers) A constructor with theMessageHeadersinstance to use.ErrorMessage(Throwable payload, MessageHeaders headers, Message<?> originalMessage) Create a new message with the payload,MessageHeadersand original message.
- 
Method SummaryModifier and TypeMethodDescriptionReturn the original message (if available) at the point in the stack where the ErrorMessage was created.toString()Methods inherited from class org.springframework.messaging.support.GenericMessageequals, getHeaders, getPayload, hashCode
- 
Constructor Details- 
ErrorMessageCreate a new message with the given payload.- Parameters:
- payload- the message payload (never- null)
 
- 
ErrorMessage
- 
ErrorMessageA constructor with theMessageHeadersinstance to use.Note: the given MessageHeadersinstance is used directly in the new message, i.e. it is not copied.- Parameters:
- payload- the message payload (never- null)
- headers- message headers
 
- 
ErrorMessageCreate a new message with the given payload and original message.- Parameters:
- payload- the message payload (never- null)
- originalMessage- the original message (if present) at the point in the stack where the ErrorMessage was created
- Since:
- 5.0
 
- 
ErrorMessageCreate a new message with the given payload, headers and original message. The content of the given header map is copied.- Parameters:
- payload- the message payload (never- null)
- headers- message headers to use for initialization
- originalMessage- the original message (if present) at the point in the stack where the ErrorMessage was created
- Since:
- 5.0
 
- 
ErrorMessageCreate a new message with the payload,MessageHeadersand original message.Note: the given MessageHeadersinstance is used directly in the new message, i.e. it is not copied.- Parameters:
- payload- the message payload (never- null)
- headers- message headers
- originalMessage- the original message (if present) at the point in the stack where the ErrorMessage was created
- Since:
- 5.0
 
 
- 
- 
Method Details- 
getOriginalMessage
- 
toString- Overrides:
- toStringin class- GenericMessage<Throwable>
 
 
-