Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

The Router Mediator is specifically designed for routing messages.

The Router Mediator can contain any number of routes. The Router Mediator can be configured to continue or to stop the mediation after the routing by setting the continueAfter attribute value to be true and false respectively. Each and every route must contain an expression attribute, which specifies the XPath over which the routing condition is evaluated. Apart from that, there can be an optional match attribute as well. If both expression and the match attributes are specified in a particular route, the evaluated string value of the XPath over the current message will be compared with the regular expression provided as the value of the match attribute. This will check whether the route matches the current message. Whereas if only the expression is specified, the presence of the element specified by the XPath is considered as the routing condition.

One can configure a route to break routing or continue evaluating further routes to see further matches by setting the breakRoute attribute to true or false respectively. For all the routes, there has to be a target element which contains information about the routing path as a sequence or an endpoint. Both can be inline as well as referred. If both are endpoints and a sequence is specified, the message will be first mediated through the sequence and sent to the endpoint after mediation. A particular target cannot contain an inline sequence and a referred sequence at the same time. The same applies to an endpoint of the target as well.

Table of Contents
maxLevel3
minLevel3
locationtop
styleborder:1
typeflat
separatorpipe

Syntax

...


<router [continueAfter=(true | false)]>
  <route expression="xpath" [match="regEx"] [breakRouter=(true | false)]>
    <target [sequence="string"] [endpoint="string"]>
      <sequence ....../>?
      <endpoint ....../>?
    </target>
  </route>+
</router>

UI Configuration

The following properties are available:

...

Image Removed

The Router Mediator has the following configuration options:

  • Continue after routing - Whether to continue the routing if any of the child routes are executed.
    • Yes
    • No
      Info
      titleTip

      The default value is "No."

  • Number of clones - Shows you the number of child routes that router mediator has.
    Info
    titleNote

    You can add child routes by clicking the "Add Route" link in the right hand side of the text field.

...

Image Removed

Here you can prepare a message to be sent to an endpoint or mediated through some more sequences.

  • SOAP Action - The SOAP action of the message.
  • To Address - The target endpoint address.
  • Sequence - Mediates the message through a sequence. You can either pick a named sequence from the registry or define an anonymous sequence by adding mediators to the current Target mediator as children.
  • Endpoint - Sends the message to an endpoint. Here you can pick a named endpoint from the registry or keep the endpoint as anonymous.
Info
titleNote

You can add in the Endpoint panel that can be accessed from the Manage-> Mediation-> Endpoints menu in the left hand side menu bar.

Info
titleNote

You can configure the Mediator using XML. Click on "switch to source view" in the "Mediator" window.

Image Removed

Example

...

router mediator has been deprecated. You can use the filter mediator or conditional router mediator instead.

Excerpt
hiddentrue

Description of the Router Mediator in WSO2 ESB.