What is covered?

- Invocation of JSR-223 scripts
- Custom transformers
- Content based routing
- Use of JVM environment variables inside Mule config file

Description

Demonstrates Mule support for JSR-223 scripting.

Under the Hood

The example takes input from a HTTP request and transforms the request's body to a Map using the HttpRequestToMap transformer. It then extracts the currency from that Map to determine the script to call. Before actually calling the script the amout will be extracted from the Map, converted into a number and normalized into an integer amout of cents. The actual script is loaded from an external file and is passed a variable called currency, which is bound to a local script variable according to the JSR-223 spec.