Created
October 26, 2012 13:34
-
-
Save germanrsolis/3958862 to your computer and use it in GitHub Desktop.
How to control if the current node is the primary polling instance
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
<flow name="main"> | |
<jms:inbound-endpoint queue="in" /> | |
<!-- check if this application is running in the primary pooling instance --> | |
<choice> | |
<when evaluator="groovy" expression="muleContext.isPrimaryPollingInstance() == true"> | |
<!-- process the message --> | |
<append-string-transformer message=" Received" /> | |
<logger level="INFO" message="#### IS PRIMARY POLLING INSTANCE, PROCESSING THE MESSAGE" /> | |
<vm:outbound-endpoint path="out"/> | |
</when> | |
<otherwise> | |
<!-- put the message back in the queue (you'd need to copy the INBOUND PROPERTIES in the OUTBOUND SCOPE so you don't loose them)--> | |
<jms:outbound-endpoint queue="in" /> | |
</otherwise> | |
</choice> | |
</flow> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment