Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3


Camel supports BeanShell among other Scripting Languages to allow an Expression or Predicate to be used in the DSL or Xml Configuration.

To use a BeanShell expression use the following Java code:

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

Or the something like this in your Spring XML:

Code Block
  <language language="beanshell">request.getHeaders().get("Foo") == null</language>
titleBeanShell Issues

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

You could follow the examples above to create an Predicate in a Message Filter or as an Expression for a Recipient List

Include Page
Scripting Languages Context
Scripting Languages Context