Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Variable

Type

Description

exchangeId

String

Camel 2.3: the exchange id

id

String

the input message id

body

Object

the input body

in.body

Object

the input body

body.OGNL

Object

Camel 2.3: the input body invoked using a Camel OGNL expression.

in.body.OGNL

Object

Camel 2.3: the input body invoked using a Camel OGNL expression.

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

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="cbffc77b963a224b-a02fed43-43244ae1-803f8912-1152f4877e2f73bfcb5dcca7"><ac:plain-text-body><![CDATA[

header.foo[bar]

Object

Camel 2.3: regard input foo header as a map and perform lookup on the map with bar as key

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c5dd814604f9f97e-2d7cb276-46054a06-bfca9f06-0d981750bc4b95d2116b1b34"><ac:plain-text-body><![CDATA[

in.header.foo[bar]

Object

Camel 2.3: regard input foo header as a map and perform lookup on the map with bar as key

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2516359daa3ed56a-84aa7301-40184f16-bb5c96e0-e3cd15d114e533db1407e39e"><ac:plain-text-body><![CDATA[

in.headers.foo[bar]

Object

Camel 2.3: regard input foo header as a map and perform lookup on the map with bar as key

]]></ac:plain-text-body></ac:structured-macro>

header.foo.OGNL

Object

Camel 2.3: refer to the input foo header and invoke its value using a Camel OGNL expression.

in.header.foo.OGNL

Object

Camel 2.3: refer to the input foo header and invoke its value using a Camel OGNL expression.

in.headers.foo.OGNL

Object

Camel 2.3: refer to the input foo header and invoke its value using a Camel OGNL expression.

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

Object

Camel 2.4: Refer to the exception object on the exchange, is null if no exception set on exchange. Will fallback and grab caught exceptions (Exchange.EXCEPTION_CAUGHT) if the Exchange has any.

exception.OGNL

Object

Camel 2.4: Refer to the exchange exception invoked using a Camel OGNLE expression object

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 (Exchange.EXCEPTION_CAUGHT) if the Exchange has any.

date:command:pattern

String

Camel 1.5. Date formatting using the java.text.SimpleDataFormat patterns. Supported commands are: now for current timestamp, in.header.xxx or header.xxx to use the Date object in the IN header with the key xxx. out.header.xxx to use the Date object in the OUT header with the key xxx.

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 locations option is optional. See more at Using PropertyPlaceholder.

threadName

String

Camel 2.3: Returns the name of the current thread. Can be used for logging purpose.

...

Code Block
simple("${in.header.foo} == 'foo'")

// ' ' can be omitted
simple("${in.header.foo} == foo")

// here Camel will type convert '100' into the type of in.header.bar and if its an Integer '100' will also be converter to an Integer
simple("${in.header.bar} == '100'")

simple("${in.header.bar} == 100")

// 100 will be converter to the type of in.header.bar so we can do > comparison
simple("${in.header.bar} > 100")
Info
titleComparing with different types

When you compare with different types such as String and int, then you have to take a bit care. Camel will use the type from the left hand side as 1st priority. And fallback to the right hand side type if both values couldn't be compared based on that type.
This means you can flip the values to enforce a specific type. Suppose the bar value above is a String. Then you can flip the equation:

Code Block

simple("100 < ${in.header.bar}")

which then ensures the int type is used as 1st priority.

This may change in the future if the Camel team improves and let the binary comparision operations be smarter and prefer numeric types over String based. It's most often the String type which causes problem when comparing with numbers.

Code Block
// testing for null
simple("${in.header.baz} == null")

// testing for not null
simple("${in.header.baz} != null")

...