saveToStash

Processor that saves the given source to a message exchange scoped storage. Stash can then be accessed later on using the given key.

Properties

Name Summary

key

The key used to eventually retrieve the object from the stash. If the key cannot be found, the operation will fail.

source

The expression used to specify the object to store in the stash.

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

Retrieving Data

Data can be pulled out of the stash using the setPayload processor and the expression syntax envelope.stash.<key>. For example:

setPayload {
    id = "set-payload"
    source = "envelope.stash.myStash.myProperty"
}

This also means the stash is available in map processors, as the following demonstrates:

map {
    id = "format-response"
    mapSpec = """
        {
            "message" : #input.stash.myStash.myProperty
        }
    """.trimIndent()
}

Scope

Stashed data is only scoped to the current flow. No stash data is distributed or forwarded to other flows. See the deleteFromStash processor for more options.