Skip to content

Instantly share code, notes, and snippets.

<flow name="SampleFlow">
<inbound-endpoint address="http://localhost:6677/" responseTimeout="1000"/>
<jersey:resources>
<component class="org.mule.transport.jersey.HelloWorldResource"/>
</jersey:resources>
</flow>
<spring:bean id="sayHello" class="org.mule.transport.jersey.HelloWorldResource" scope="prototype"/>
<model name="SampleModel">
<service name="SampleService">
<inbound>
<inbound-endpoint address="jersey:http://localhost:6677/"
responseTimeout="1000" synchronous="true"/>
</inbound>
<component>
<spring-object bean="sayHello"/>
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:file="http://www.mulesource.org/schema/mule/file/2.2"
xmlns:jms="http://www.mulesource.org/schema/mule/jms/2.2"
xsi:schemaLocation="
http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
http://www.mulesource.org/schema/mule/file/2.2 http://www.mulesource.org/schema/mule/file/2.2/mule-file.xsd
http://www.mulesource.org/schema/mule/jms/2.2 http://www.mulesource.org/schema/mule/jms/2.2/mule-jms.xsd">
<?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:file="http://www.mulesoft.org/schema/mule/file"
xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.1/mule-file.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/3.1/mule-jms.xsd">
<flow name="choiceFlow">
<description>
Flow that shows the use of the choice element for content-based routing
<description>
<jms:inbound-endpoint queue="in"/>
<choice>
<when expression="/element/@name = 'foo'" evaluator="xpath">
<jms:outbound-endpoint queue="fooQueue"/>
</when>
<when expression="/element/@name = 'bar'" evaluator="xpath">
<bridge name="nasdaqCompositePoller" exchange-pattern="one-way">
<poll frequency="360000">
<outbound-endpoint address="${nasdaq.composite.feed.url}" />
</poll>
<amqp:outbound-endpoint ref="financialExchange"
routingKey="stockmarket.nasdaq.composite" />
</bridge>
<?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:http="http://www.mulesoft.org/schema/mule/http"
xmlns:amqp="http://www.mulesoft.org/schema/mule/amqp"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.1/mule-file.xsd
<logger message="Ooops! #[payload] is an invalid message!" level="ERROR" />
<logger message="Accept Header is #[header:INBOUND:Accept]" level="INFO" />
<logger message="just processed foo" level="DEBUG" />
<flow name="orderProcessingFlow">
<inbound-endpoint ref="orderEndpoint"/>
<enricher target="#[variable:state_short]">
<outbound-endpoint ref="stateLookup">
<expression-transformer evaluator="xpath" expression="/order/address/zip" />
</outbound-endpoint>
</enricher>
<outbound-endpoint ref="orderStep2"/>
</flow>