setExchangeProperty

Processor that saves a given source to a message exchange property. Value is saved as a string by a given MarshallingFormat.

Properties

Name Summary

marshallingFormat

The given marshalling format. If not set, the toString() value of the source is used.

propertyName

The name of the target property.

source

The path for the source element, evaluated from an expression.

replaceExisting

Whether any existing headers with the same name are removed and replaced by the new header. This is the default ( true) behavior. If false, the header is added on top of existing headers with the same name.

skipOnNullSourceValue

Whether setting the exchange property is skipped ( true) or fails the process ( false) when the result of the source expression is null. Defaults to false.

name

Optional, descriptive name for the processor.

id

Required identifier of the processor, unique across all processors within the flow. Must be between 3 and 30 characters long; contain only lower and uppercase alphabetical characters (a-z and A-Z), numbers, dashes ("-"), and underscores ("_"); and start with an alphabetical character. In other words, it adheres to the regex pattern [a-zA-Z][a-zA-Z0-9_-]{2,29}.

exchangeProperties

Optional set of custom properties in a simple jdk-format, that are added to the message exchange properties before processing the incoming payload. Any existing properties with the same name will be replaced by properties defined here.

retainPayloadOnFailure

Whether the incoming payload is available for error processing on failure. Defaults to false.

Sub-builders

Name Summary

messageLoggingStrategy

Strategy for describing how a processor’s message is logged on the server.

payloadArchivingStrategy

Strategy for archiving payloads.

inboundTransformationStrategy

Strategy that customizes the conversion of an incoming payload by a processor (e.g., string to object). Should be used when the processor’s default conversion logic cannot be used.

Details

Examples

The setExchangeProperty processor sets a message exchange property (identified by propertyName) by evaluating the expression defined in the source property. For example:

setExchangeProperty {
    id = "set-property"
    propertyName = "myProperty"
    source = "envelope.payload.myValue"
}

Expressions can also be hardcoded strings using single quotes. For example:

setExchangeProperty {
    id = "set-property"
    propertyName = "myProperty"
    source = "'hardcoded string'"
}