In the XML DSL, you can use a simple expression by putting inside a
simple
element. For example, to define a route that performs
filtering based on the contents of the foo
header:
<route id="simpleExample"> <from uri="seda:orders"/> <filter> <simple>in.header.foo</simple> <to uri="mock:fooOrders"/> </filter> </route>
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?</simple>
Sometimes—for example, if you have enabled Spring property placeholders or
OSGi blueprint property placeholders—you might find that the
${
syntax clashes with
another property placeholder syntax. In this case, you can disambiguate the
placeholder using the alternative syntax,
Expression
}$simple{
, for the simple
expression. For example:Expression
}
<simple>Hello $simple{in.header.name}, how are you?</simple>