Standard service activator
Service activator that evaluates a SpEL expression or Groovy script for each incoming message.
While all other service activators have very specific uses, this component is extremely flexible. The downside is that this service activator can be harder to use because it involves scripting.
Allows you to define custom script variable bindings. This attribute isn't mutually exclusive with variables setting (see the basic tab) and all variables will be merged to one map.
The variables
payload
and headers
are always automatically available, even if you do not manually specify any variables. Since these two variables already give you access to all information in the message from your Groovy script, the main use-case for custom variables is probably to pass property values to the script.
All custom non-ref variables will be passed as a value of type String
to the Groovy script. If required, you can easily convert the data type using the Groovy as
keyword. For example: variableName as Integer
.
_id
Channel where output messages, if this service activator generates any, should be sent after (successfully) processing the input message.
You can select the nullChannel
here to silently drop the output messages.
If requires reply is set to true
, specifying an output channel is required. Otherwise this is an optional setting.
_id
Channel where output messages, if this service activator generates any, should be sent after (successfully) processing the input message.
You can select the nullChannel
here to silently drop the output messages.
If requires reply is set to true
, specifying an output channel is required. Otherwise this is an optional setting.
Advice can be added to change the behaviour of this endpoint, for example to add retry logic in case of failures. The following types of advice are available:
Retry advice: allows configuration of sophisticated retry scenarios; this includes specifying policies for retry attemps, backoff periods between attempts and the recovery strategy when retries are exhausted Circuit breaker: if a certain number of consecutive attempts fails, new requests will fail fast and no attempt will be made to invoke the request handler again until some time has expired Expression evaluating advice: general advice that evaluates a configurable SpEL expression on successful and/or failed attempts, and optionally can send a message to a success channel and/or failure channel
By adding multiple advices to this endpoint you can create even more complex combined behaviour. For example, if you add a circuit breaker and a retry advice, you can create a scenario where the circuit breaker only opens when all retries are exhaused. Note that the order of the advice types is important, as switching the order will change the combined behaviour: the first item in the list will be the top of the advice chain, meaning it will be the last advice that is evaluated. Also note that if any advice "traps" exceptions, all advices higher up in the chain won't know about any failures.
_id
Channel to consume the input messages from.
Required
_id
Channel to consume the input messages from.
Required