Skip to content

Instantly share code, notes, and snippets.

@ricston-git
Last active December 12, 2015 08:49
Show Gist options
  • Save ricston-git/4746735 to your computer and use it in GitHub Desktop.
Save ricston-git/4746735 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
xmlns:rest="http://www.mulesoft.org/schema/mule/rest"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/current/mule-jdbc.xsd
http://www.mulesoft.org/schema/mule/rest http://www.mulesoft.org/schema/mule/rest/current/mule-rest.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
...
<rest:config/>
<flow name="RestFlow">
<http:inbound-endpoint address="http://localhost:8080"/>
<rest:router templateUri="/task/{taskId}">
<rest:get>
<expression-transformer evaluator="variable" expression="taskId"/>
<jdbc:outbound-endpoint exchange-pattern="request-response" queryKey="getTask"/>
<custom-transformer class="com.ricston.TaskTransformer"/>
</rest:get>
<rest:post>
<expression-transformer evaluator="variable" expression="taskId"/>
<jdbc:outbound-endpoint queryKey="writeTask"/>
<expression-transformer evaluator="string" expression="Task #[payload] saved"/>
</rest:post>
</rest:router>
<rest:router templateUri="/tasks">
<rest:get>
<jdbc:outbound-endpoint exchange-pattern="request-response" queryKey="getTaskList"/>
<custom-transformer class="com.ricston.TaskListTransformer"/>
</rest:get>
</rest:router>
</flow>
</mule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment