You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Python

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

To use a Python expression use the following Java code

import static org.apache.camel.builder.script.ScriptBuilder.*;

...

... python("somePythonExpression") ... 

For example you could use the python function to create an Predicate in a Message Filter or as an Expression for a Recipient List

Since you can't get the python expression script evaluation result from the script engine, you need to add a prefix " result = " before your expression.
We will take the result variable as the expression result.

  • No labels