Error to XML transformer
Transformer that converts error messages into XML messages.
Transformer that converts error messages (i.e. a message with a Throwable
payload) to XML.
The result of this transformation will be a complete, well-formed XML document as a string (the default), XOM document or DOM document. The layout of this document is defined by the XML schema located at:
classpath:com/emagiz/components/error/emagiz-error-1.0.xsd
The payload of the failed message is converted to a string value using an XML to string transformer or Base64 encoding transformer (depending on the type), or if that fails by calling String.valueOf(Object)
on the payload. This potentially expensive conversion can be skipped by setting omit payload. To further reduce the size of the resulting XML, the stacktrace can also be omitted using omit stack trace.
Omit stack trace
Whether to omit the stack trace of the exception (if there is one) in the resulting XML or not.
Default is true.
Omit payload
Whether to omit the payload of the original message (if there is one) in the resulting XML or not.
Default is false.
Restore headers
Determines how to attempt restoring the messages headers from the original message on the resulting error message. This includes restoring the message history and tracking information (if any) of the original message.
If the exception message doesn't contain the original message, headers cannot be restored, but setting this property to a value other than do not restore headers will not cause exceptions in such a case.
Options for restoring the message headers of the input message and the original message on the output message are:
- Restore all headers: Restore all input and original headers on the output message. In case of duplicate header names, the input header takes precedence over the original header.
- Restore all headers (with overwrite): Restore all input and original headers on the output message. In case of duplicate header names, the original header overwrites the input header.
- Restore serializable headers only: Only restore serializable input and original headers on the output message. In case of duplicate header names, the input header takes precedence over the original header.
- Restore serializable headers only (with overwrite): Only restore serializable input and original headers on the output message. In case of duplicate header names, the original header overwrites the input header.
- Do not restore headers: No original headers are restored on the output message, but all input headers are (this includes any non-serializable values).
Note that the history header is treated slightly different from what is described above: multiple values of this header are always merged to preserve the correct message history (unless option do not restore headers is used).
Please be aware that the replyChannel and errorChannel headers that are used for the error handling of inbound gateways are non-serializable: if you want to "loop back" the error channel of an inbound gateway to its reply channel, you must select either restore all headers or do not restore headers in order for the error handling to work properly.
Default is restore serializable headers only.
Result type
Sets the result type (XomDocument
, DomDocument
or String
) for the transformation.
Default is String
.
Output channel
Channel where output messages should be sent after (successfully) processing the input message.
You can select the nullChannel
here to silently drop the output messages.
Required
Input channel
Channel to consume the input messages from.
Required
Id
Name that uniquely identifies this flow component.
Required