Mule REST Router
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

REST Router Module

A Mule module for implementing REST Router whit-in flows. The module includes a custom router that will dispatch the message to the inner message processors as long as the URI matches and the processors are attached to the right HTTP method.


The module can either be installed for all applications running within the Mule instance or can be setup to be used for a single application.

All Applications

Download the module from the link above and place the resulting jar file in /lib/user directory of the Mule installation folder.

Single Application

To make the module available only to single application then place it in the lib directory of the application otherwise if using Maven to compile and deploy your application the following can be done:

Add the connector's maven repo to your pom.xml:

        <name>MuleForge Releases Repository</name>

Add the connector as a dependency to your project. This can be done by adding the following under the dependencies element in the pom.xml file of the application:



A REST router is an intercepting message processor that will only execute if the incoming message contains a http.request.path property that matches the templareUri parameter.

An URI template is a URI-like String that contained variables marked of in braces ({, }), which can be expanded to produce a URI.

The following is an example URI template:


If the incoming URI matches the template it will extract the variables in it and it will make them available as properties.

<rest-router:router templateUri="http://{userid}{title}/feed">
            <return-argument evaluator="string" expression="Retrieving comment on #[variable:title] for user #[variable:userid]"/>
            <return-argument evaluator="string" expression="Creating comment on #[variable:title] for user #[variable:userid]"/>
            <return-argument evaluator="string" expression="Updating comment on #[variable:title] for user #[variable:userid]"/>
            <return-argument evaluator="string" expression="Deleting comment on #[variable:title] for user #[variable:userid]"/>