Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To use a BeanShell expression use the following Java code:

Code Block
... beanShell("someBeanShellExpression") ... choice()
    .when(script("beanshell", "request.getHeaders().get(\"foo\").equals(\"bar\")"))
       .to("...")

Or the something like this in your Spring XML:

...

Note
titleBeanShell Issues

You must use BeanShell 2.0b5 or greater. Note that as of 2.0b5 BeanShell cannot compile scripts, which causes most releases of Camel Camel releases before 2.6 to fail when configured with BeanShell expressions.

For example you You could use follow the beanShell function examples above to create an Predicate in a Message Filter or as an Expression for a Recipient List

...