In our services, we can check boolean conditions in a simple way using the filter mediator, which performs actions such as the if else structure that we found in most of the programming languages. Once more, we can use this mediator for XML or JSON messages.
The following is the syntax:
<filter (source="[XPath|json-eval(JSONPath)]" regex="string") | xpath="[XPath|json-eval(JSONPath)]"> <then [sequence="string"]> mediator+ </then> <else [sequence="string"]> mediator+ </else> </filter>
As we can see in the syntax, this mediator has multiple options, and we can use it from different configurations. The else tag is optional, and we can specify the logical behavior inline or with an external sequence.
In the first example, we will filter the incoming...