Skip to content

Instantly share code, notes, and snippets.

@marianogonzalez
Created October 3, 2014 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marianogonzalez/6ff292e44ab4ce5123dc to your computer and use it in GitHub Desktop.
Save marianogonzalez/6ff292e44ab4ce5123dc to your computer and use it in GitHub Desktop.
<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>
@nearnshaw
Copy link

since this article will be published in 3.6, shouldn't the http:inbound-endpoint be changed for the new http connector?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment