In the Java DSL, there are two styles for using the simple() command
in a route. You can either pass the simple() command as an argument to
a processor, as follows:
from("seda:order")
.filter(simple("${in.header.foo}"))
.to("mock:fooOrders");Or you can call the simple() command as a sub-clause on the
processor, for example:
from("seda:order")
.filter()
.simple("${in.header.foo}")
.to("mock:fooOrders");If you are embedding a simple expression inside a plain text string, you must use
the placeholder syntax, ${. For
example, to embed the Expression}in.header.name expression in a string:
simple("Hello ${in.header.name}, how are you?")From Java, you can customize the start and end tokens ({ and
}, by default) by calling the changeFunctionStartToken
static method and the changeFunctionEndToken static method on the
SimpleLanguage object.
For example, you can change the start and end tokens to [ and
] in Java, as follows:
// Java
import org.apache.camel.language.simple.SimpleLanguage;
...
SimpleLanguage.changeFunctionStartToken("[");
SimpleLanguage.changeFunctionEndToken("]");![]() | Note |
|---|---|
Customizing the start and end tokens affects all Apache Camel applications that
share the same |






![[Note]](imagesdb/note.gif)


