The Loopback Mediator moves the message is used to move messages from the In in flow to the Out out flow. All the configuration included in the In flow in sequence that appears after the Loopback mediator is skipped.
...
The loopback token refers to a <loopback
> element, which is used to skip the rest of the In in flow and move the message to the Out out flow:.
Code Block | ||||
---|---|---|---|---|
| ||||
<loopback/> |
...
As with other mediators, after adding the Loopback mediator to a sequence, you can click its up and down arrows to move its location in the sequence.
Example
Following This example is a main sequence configuration with two payload factories. Let's assume PayloadFactory mediators. Assume you only want to use the first factory but need to keep the second factory in the configuration for future reference. To skip the second factory, add the The Loopback mediator is added after the first factory PayloadFactory mediator configuration to skip the second PayloadFactory mediator configuration. This configuration will cause the message to be processed with the first payload factory and then immediately move to the Out out flow, skipping the second payload factory in the In in flow.
Code Block | ||||
---|---|---|---|---|
| ||||
<definitions xmlns="http://ws.apache.org/ns/synapse"> <sequence name="main"> <in> <payloadFactory> <format> <m:messageBeforeLoopBack xmlns:m="http://services.samples"> <m:messageBeforeLoopBackSymbol> <m:symbolBeforeLoopBack>$1</m:symbolBeforeLoopBack> </m:messageBeforeLoopBackSymbol> </m:messageBeforeLoopBack> </format> <args> <arg xmlns:m0="http://services.samples" evaluator="xml" expression="//m0:symbol/text()"/> </args> </payloadFactory> <loopback/> <payloadFactory> <format> <m:messageAfterLoopBack xmlns:m="http://services.samples"> <m:messageAfterLoopBackSymbol> <m:symbolAfterLoopBack>$1</m:symbolAfterLoopBack> </m:messageAfterLoopBackSymbol> </m:messageAfterLoopBack> </format> <args> <arg xmlns:m0="http://services.samples" evaluator="xml" expression="//m0:symbolBeforeLoopBack/text()"/> </args> </payloadFactory> </in> <out> <send/> </out> </sequence> </definitions> |