Skip to content

Instantly share code, notes, and snippets.

@johndemic
Created February 6, 2012 21:11
Show Gist options
  • Save johndemic/1754910 to your computer and use it in GitHub Desktop.
Save johndemic/1754910 to your computer and use it in GitHub Desktop.
Mule Esper Example: Comparing to Drools
<flow name="processStockTicks">
<composite-source>
<inbound-endpoint ref="stockTick"/>
<ajax:inbound-endpoint channel="/services/cepExample/thresholdChange"/>
</composite-source>
<all>
<ajax:outbound-endpoint channel="/services/cepExample/stockTick"/>
<esper:send eventPayload-ref="#[payload:]"/>
</all>
</flow>
<flow name="sendAlerts">
<esper:listen statement="
select symbol,price,(Math.abs(first(price) - last(price)) / first(price)) * 100.0 as percentChange
from StockTick.win:time(2 min) group by symbol
having (Math.abs(first(price) - last(price)) / first(price)) * 100.0 > 7.0 "/>
<vm:outbound-endpoint path="alerts.out"/>
</flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment