The Conditional Router Mediator (New in version 4.0) can be used to specify the routing of the message according to given conditions. This mediator checks whether the "Condition" evaluates to true and mediates using the target sequence. A matching route will break the router if the "Break after route" is set to true.
Syntax
<conditionalRouter continueAfter="(true|false)"> <route breakRoute="(true|false)"> <condition ../> <target ../> </route>+ </conditionalRouter>
UI Configuration
1. The user can define any number of routes. Each and every route must contain a "condition" which is to be evaluated and a predefined "Target" sequence, which will be used to mediate further. To add a route, click on the "Add Route" link.
2. Specify the following option of the Route:
Parameter Name | Description |
---|---|
Continue after routing | This parameter specifies whether the mediation flow should/should not continue after executing the conditional router mediator. Possible values are as follows.
|
Break after route | You can specify this for each conditional route of the conditional route mediator. It specifies whether the router should/should not continue after executing the specified conditional route.
|
Evaluator Expression | Route condition. For example, you can specify that a message is routed based on the its header (provides better performance) or its content (provides more fine-grained searching). |
Target Sequence | A target sequence needs to be provided as registry key/local entry to do further mediation processing. |
Example
To see an example of the Conditional Router mediator, see Sample 157: Conditional Router for Routing Messages based on HTTP URL, HTTP Headers and Query Parameters.