THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
For example you could use the groovy function to create an Predicate in a Message Filter or as an Expression for a Recipient List
Groovy processors
You can use Groovy closures to define the processors in Java DSL. Static method org.apache.camel.groovy.extend.CamelGroovyMethods.toProcessor
provides a bridge between Groovy closures and Java:
Code Block | ||
---|---|---|
| ||
import static org.apache.camel.groovy.extend.CamelGroovyMethods.toProcessor
...
from("direct:start").processor(toProcessor{ Exchange exchange ->
exchange.in.body = 'body'
}); |
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") |
...