...
Variable | Type | Description |
---|---|---|
id | String | the input message id |
body | Object | the input body |
in.body | Object | the input body |
bodyAs(type) | Type | Camel 2.3: Converts the body to the given type determined by its classname. |
out.body | Object | the output body |
header.foo | Object | refer to the input foo header |
headers.foo | Object | refer to the input foo header |
in.header.foo | Object | refer to the input foo header |
in.headers.foo | Object | refer to the input foo header |
out.header.foo | Object | refer to the out header foo |
out.headers.foo | Object | refer to the out header foo |
property.foo | Object | refer to the foo property on the exchange |
sys.foo | String | refer to the system property |
sysenv.foo | String | Camel 2.3: refer to the system environment |
exception.message | String | Camel 2.0. Refer to the exception.message on the exchange, is null if no exception set on exchange. Will fallback and grab caught exceptions ( |
date:command:pattern | String | Camel 1.5. Date formatting using the |
bean:bean expression | Object | Camel 1.5. Invoking a bean expression using the Bean language. Specifying a method name you must use dot as separator. In Camel 2.0 we also support the ?method=methodname syntax that is used by the Bean component. |
properties:locations:key | String | Camel 2.3: Lookup a property with the given key. The |
...
Code Block | ||||
---|---|---|---|---|
| ||||
from("direct:order").transform().simple("OrderId: ${bean:orderIdGenerator?method=generateId}").to("mock:reply"); |
And from Camel 2.3 onwards you can also convert the body to a given type, for example to ensure its a String you can do:
Code Block | ||||
---|---|---|---|---|
| ||||
<transform>
<simple>Hello ${bodyAs(String)} how are you?</simple>
</transform>
|
There is a few types which have a shorthand notation, hence why we can use String
instead of java.lang.String
. These are: byte[], String, Integer, Long
. All other types must use their FQN name, e.g. org.w3c.dom.Document
.
Dependencies
The Bean language is part of camel-core.