Skip to content

Instantly share code, notes, and snippets.

@cjmamo
Created June 16, 2012 12:37
Show Gist options
  • Save cjmamo/2941235 to your computer and use it in GitHub Desktop.
Save cjmamo/2941235 to your computer and use it in GitHub Desktop.
Mule meet ZeroMQ. ZeroMQ meet Mule.
<flow name="MultipartInboundFlow">
<zeromq:inbound-endpoint address="tcp://*:9090" socket-operation="bind"
exchange-pattern="pull"/>
<expression-transformer evaluator="groovy" expression="payload[3]"/>
...
</flow>
<flow name="BackendFlow">
<zeromq:inbound-endpoint address="tcp://*:9090" socket-operation="bind"
exchange-pattern="request-response"/>
...
</flow>
<flow name="MultipartOutboundFlow">
...
<expression-transformer evaluator="groovy"
expression="['1st part', '2nd part', '3rd part', '4th part', '5th part']"/>
<zeromq:outbound-endpoint address="tcp://192.168.34.10:9090"
socket-operation="connect" multipart="true" exchange-pattern="push"/>
</flow>
<flow name="FrontEndFlow">
<http:inbound-endpoint address="http://localhost:8080/frontend"/>
<zeromq:outbound-endpoint address="tcp://192.168.34.10:9090"
socket-operation="connect" exchange-pattern="one-way"/>
</flow>
<?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:zeromq="http://www.mulesoft.org/schema/mule/zeromq"
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/zeromq http://www.mulesoft.org/schema/mule/zeromq/1.0/mule-zeromq.xsd">
<flow name="FrontEndFlow">
<http:inbound-endpoint address="http://localhost:8080/frontend"/>
<zeromq:outbound-endpoint address="tcp://192.168.34.10:9090"
socket-operation="connect" exchange-pattern="request-response"/>
</flow>
</mule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment