Created
October 25, 2011 22:59
-
-
Save ddossot/1314673 to your computer and use it in GitHub Desktop.
mule-agent-based-sync-http-request-handling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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: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.2/mule.xsd | |
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.2/mule-http.xsd | |
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/3.2/mule-jms.xsd"> | |
<jms:activemq-connector name="amqConnector" specification="1.1" /> | |
<!-- Global Transformers --> | |
<object-to-string-transformer name="object-to-string-transformer" /> | |
<message-properties-transformer name="outbound-properties-remover" | |
scope="outbound"> | |
<delete-message-property key=".*"/> | |
</message-properties-transformer> | |
<!-- Single Agent Service --> | |
<bridge name="single-agent-service" | |
inboundAddress="http://localhost:8080/capitalizer" | |
transformer-refs="object-to-string-transformer outbound-properties-remover" | |
outboundAddress="jms://services.capitalizer" | |
exchange-pattern="request-response" /> | |
<!-- Dynamic Agent Service --> | |
<bridge name="dynamic-agent-service" | |
inboundAddress="http://localhost:8080/services" | |
transformer-refs="object-to-string-transformer outbound-properties-remover" | |
outboundAddress="jms://#[groovy:message.getInboundProperty('http.request.path').substring(1).replace('/','.')]" | |
exchange-pattern="request-response" /> | |
<!-- Request Processing Agents --> | |
<flow name="capitalizer-agent"> | |
<jms:inbound-endpoint queue="services.capitalizer" /> | |
<expression-transformer> | |
<return-argument evaluator="groovy" | |
expression="org.apache.commons.lang.WordUtils.capitalize(payload)" /> | |
</expression-transformer> | |
</flow> | |
<flow name="doublemetaphone-agent"> | |
<jms:inbound-endpoint queue="services.doublemetaphone" /> | |
<expression-transformer> | |
<return-argument evaluator="groovy" | |
expression="new org.apache.commons.codec.language.DoubleMetaphone().encode(payload)" /> | |
</expression-transformer> | |
</flow> | |
</mule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment