Created
October 3, 2014 14:19
-
-
Save marianogonzalez/6ff292e44ab4ce5123dc to your computer and use it in GitHub Desktop.
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="greedy"> | |
<http:inbound-endpoint host="localhost" port="${httpPort}" path="change-machine" | |
exchange-pattern="request-response"/> | |
<http:body-to-parameter-map-transformer /> | |
<set-payload value="#[payload['amount']]" /> | |
<transformer ref="StringToNumber" /> | |
<transformer ref="DollarsToCents"/> | |
<choice> | |
<when expression="payload.currency == 'USD'"> | |
<scripting:component doc:name="USD Currency Script"> | |
<scripting:script file="greedy.groovy"> | |
<property key="currency" value="USD"/> | |
</scripting:script> | |
</scripting:component> | |
</processor-chain> | |
</when> | |
<when expression="payload.currency == 'GBP'"> | |
<processor-chain> | |
<scripting:component doc:name="GBP Currency Script"> | |
<scripting:script file="greedy.py"> | |
<property key="currency" value="GBP"/> | |
</scripting:script> | |
</scripting:component> | |
</processor-chain> | |
</when> | |
</choice> | |
</flow> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
since this article will be published in 3.6, shouldn't the http:inbound-endpoint be changed for the new http connector?