Created
February 6, 2012 21:11
-
-
Save johndemic/1754910 to your computer and use it in GitHub Desktop.
Mule Esper Example: Comparing to Drools
This file contains hidden or 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
<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