...
To use a Groovy _expression_ use the following Java code
Code Block |
|
... groovy("someGroovyExpression") ...
|
For example you could use the groovy function to create an Predicate in a Message Filter or as an _expression_ for a Recipient List
Example
Code Block |
|
// lets route if a line item is over $100
from("queue:foo").filter(groovy("request.lineItems.any { i -> i.value > 100 }")).to("queue:bar")
|
And the Spring DSL:
Code Block |
|
<route>
<from uri="queue:foo"/>
<filter>
<groovy>request.lineItems.any { i -> i.value > 100 }</groovy>
<to uri="queue:bar"/>
</filter>
</route>
|
Include Page |
|
Scripting Languages Context |
|