Skip to content

Commit

Permalink
SWITCHYARD-1411 Allow multiple route definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
splatch committed May 22, 2013
1 parent 687301d commit 48b8712
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 58 deletions.
36 changes: 19 additions & 17 deletions camel-service/src/main/resources/META-INF/route.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,23 @@
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<route xmlns="http://camel.apache.org/schema/spring">
<from uri="switchyard://XMLService"/>
<log message="Inside XML Camel Route"/>
<routes xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="switchyard://XMLService"/>
<log message="Inside XML Camel Route"/>

<choice>
<when>
<ognl>request.body == ' I like cheese'</ognl>
<log message="[ognl message] 'sally:${body}'"/>
</when>
<when>
<mvel>request.body == ' And milk too'</mvel>
<log message="[mvel message] 'sally:${body}'"/>
</when>
<otherwise>
<log message="[message] 'sally:${body}'"/>
</otherwise>
</choice>
</route>
<choice>
<when>
<ognl>request.body == ' I like cheese'</ognl>
<log message="[ognl message] 'sally:${body}'"/>
</when>
<when>
<mvel>request.body == ' And milk too'</mvel>
<log message="[mvel message] 'sally:${body}'"/>
</when>
<otherwise>
<log message="[message] 'sally:${body}'"/>
</otherwise>
</choice>
</route>
</routes>
10 changes: 6 additions & 4 deletions camel-soap-proxy/src/main/resources/META-INF/route.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<route xmlns="http://camel.apache.org/schema/spring">
<from uri="switchyard://ProxyService"/>
<to uri="switchyard://ReverseService"/>
</route>
<routes xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="switchyard://ProxyService"/>
<to uri="switchyard://ReverseService"/>
</route>
</routes>
44 changes: 23 additions & 21 deletions rules-camel-cbr/src/main/resources/META-INF/route.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<route xmlns="http://camel.apache.org/schema/spring">
<from uri="switchyard://RoutingService"/>
<to uri="switchyard://DestinationService"/>
<choice>
<when>
<simple>${body.destination} == 'Red'</simple>
<to uri="switchyard://RedService"/>
</when>
<when>
<simple>${body.destination} == 'Green'</simple>
<to uri="switchyard://GreenService"/>
</when>
<when>
<simple>${body.destination} == 'Blue'</simple>
<to uri="switchyard://BlueService"/>
</when>
<otherwise>
<log message="Unknown Destination!"/>
</otherwise>
</choice>
</route>
<routes xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="switchyard://RoutingService"/>
<to uri="switchyard://DestinationService"/>
<choice>
<when>
<simple>${body.destination} == 'Red'</simple>
<to uri="switchyard://RedService"/>
</when>
<when>
<simple>${body.destination} == 'Green'</simple>
<to uri="switchyard://GreenService"/>
</when>
<when>
<simple>${body.destination} == 'Blue'</simple>
<to uri="switchyard://BlueService"/>
</when>
<otherwise>
<log message="Unknown Destination!"/>
</otherwise>
</choice>
</route>
</routes>
13 changes: 8 additions & 5 deletions soap-attachment/src/main/resources/META-INF/filter.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<route xmlns="http://camel.apache.org/schema/spring" id="org.switchyard.quickstarts.soap-attachment.external">
<log message="Request is: ${body}" />
<process ref="customProcessor"/>
<log message="Response is: ${body}" />
</route>
<routes xmlns="http://camel.apache.org/schema/spring">
<route id="org.switchyard.quickstarts.soap-attachment.external">
<from uri="switchyard://EchoService"/>
<log message="Request is: ${body}" />
<process ref="customProcessor"/>
<log message="Response is: ${body}" />
</route>
</routes>
15 changes: 9 additions & 6 deletions soap-attachment/src/main/resources/META-INF/route.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<route xmlns="http://camel.apache.org/schema/spring" id="org.switchyard.quickstarts.soap-attachment">
<log message="Request is: ${body}" />
<process ref="internalCustomProcessor"/>
<to uri="switchyard://EchoImageService?operationName=echoImage"/>
<log message="Response is: ${body}" />
</route>
<routes xmlns="http://camel.apache.org/schema/spring">
<route id="org.switchyard.quickstarts.soap-attachment">
<from uri="switchyard://InternalEchoService"/>
<log message="Request is: ${body}" />
<process ref="internalCustomProcessor"/>
<to uri="switchyard://EchoImageService?operationName=echoImage"/>
<log message="Response is: ${body}" />
</route>
</routes>
13 changes: 8 additions & 5 deletions soap-binding-rpc/src/main/resources/META-INF/route.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<route xmlns="http://camel.apache.org/schema/spring" id="org.switchyard.quickstarts.soap-binding-rpc">
<log message="Request is: ${body}" />
<to uri="switchyard://HelloWorldWSExternal?operationName=sayHello"/>
<log message="Response is: ${body}" />
</route>
<routes xmlns="http://camel.apache.org/schema/spring">
<route id="org.switchyard.quickstarts.soap-binding-rpc">
<from uri="switchyard://HelloService"/>
<log message="Request is: ${body}" />
<to uri="switchyard://HelloWorldWSExternal?operationName=sayHello"/>
<log message="Response is: ${body}" />
</route>
</routes>

0 comments on commit 48b8712

Please sign in to comment.