Class ErrorMessage
- java.lang.Object
- org.springframework.messaging.support.GenericMessage<Throwable>
- org.springframework.messaging.support.ErrorMessage
- All Implemented Interfaces:
Serializable
,Message<Throwable>
public class ErrorMessage extends GenericMessage<Throwable>
AGenericMessage
with aThrowable
payload.- Since:
- 4.0
- Author:
- Mark Fisher, Oleg Zhurakousky
- See Also:
MessageBuilder
, Serialized Form
Constructor Summary
Constructors Constructor Description ErrorMessage(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.ErrorMessage(Throwable payload, MessageHeaders headers)
A constructor with theMessageHeaders
instance to use.
Method Summary
Methods inherited from class org.springframework.messaging.support.GenericMessage
equals, getHeaders, getPayload, hashCode, toString
Constructor Detail
ErrorMessage
public ErrorMessage(Throwable payload)
Create a new message with the given payload.- Parameters:
payload
- the message payload (nevernull
)
ErrorMessage
public ErrorMessage(Throwable payload, Map<String,Object> headers)
Create a new message with the given payload and headers. The content of the given header map is copied.- Parameters:
payload
- the message payload (nevernull
)headers
- message headers to use for initialization
ErrorMessage
public ErrorMessage(Throwable payload, MessageHeaders headers)
A constructor with theMessageHeaders
instance to use.Note: the given
MessageHeaders
instance is used directly in the new message, i.e. it is not copied.- Parameters:
payload
- the message payload (nevernull
)headers
- message headers