ErrorMessage

A {@link GenericMessage} with a {@link Throwable} payload.

<p>The payload is typically a {@link hunt.stomp.MessagingException} with the message at the point of failure in its {@code failedMessage} property. An optional {@code originalMessage} may be provided, which represents the message that existed at the point in the stack where the error message is created.

<p>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.

@author Mark Fisher @author Oleg Zhurakousky @author Gary Russell @since 4.0 @see MessageBuilder

Constructors

this
this(Throwable payload)

Create a new message with the given payload. @param payload the message payload (never {@code null})

this
this(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. @param payload the message payload (never {@code null}) @param headers message headers to use for initialization

this
this(Throwable payload, MessageHeaders headers)

A constructor with the {@link MessageHeaders} instance to use. <p><strong>Note:</strong> the given {@code MessageHeaders} instance is used directly in the new message, i.e. it is not copied. @param payload the message payload (never {@code null}) @param headers message headers

this
this(Throwable payload, MessageBase originalMessage)

Create a new message with the given payload and original message. @param payload the message payload (never {@code null}) @param originalMessage the original message (if present) at the point in the stack where the ErrorMessage was created @since 5.0

this
this(Throwable payload, Map!(string, Object) headers, MessageBase originalMessage)

Create a new message with the given payload, headers and original message. The content of the given header map is copied. @param payload the message payload (never {@code null}) @param headers message headers to use for initialization @param originalMessage the original message (if present) at the point in the stack where the ErrorMessage was created @since 5.0

this
this(Throwable payload, MessageHeaders headers, MessageBase originalMessage)

Create a new message with the payload, {@link MessageHeaders} and original message. <p><strong>Note:</strong> the given {@code MessageHeaders} instance is used directly in the new message, i.e. it is not copied. @param payload the message payload (never {@code null}) @param headers message headers @param originalMessage the original message (if present) at the point in the stack where the ErrorMessage was created @since 5.0

Members

Functions

getOriginalMessage
MessageBase getOriginalMessage()

Return the original message (if available) at the point in the stack where the ErrorMessage was created. @since 5.0

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta