Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

You can append query options to the URI in the following format, ?option=value&option=value&...

Options

Div
classconfluenceTableSmall

Option

Default

Description

loaderCache

true

Velocity based file loader cache.

contentCache

true

Cache for the resource content when it is loaded.
Note : as of Camel 2.9 cached resource content can be cleared via JMX using the endpoint's clearContentCache operation.

encoding

null

Character encoding of the resource content.

propertiesFile

null

New option in Camel 2.1: The URI of the properties file which is used for VelocityEngine initialization.

Wiki Markup
{div:class=confluenceTableSmall} || Option || Default || Description || | {{loaderCache}} | {{true}} | Velocity based file loader cache. | | {{contentCache}} | {{true}} | Cache for the resource content when it is loaded. \\ Note : as of Camel 2.9 cached resource content can be cleared via JMX using the endpoint's {{clearContentCache}} operation. | | {{encoding}} | {{null}} | Character encoding of the resource content. | | {{propertiesFile}} | {{null}} | New option in Camel 2.1: The URI of the properties file which is used for VelocityEngine initialization. | {div}

Message Headers

The velocity component sets a couple headers on the message (you can't set these yourself and from Camel 2.1 velocity component will not set these headers which will cause some side effect on the dynamic template support):

Div
classconfluenceTableSmall

Header

Description

CamelVelocityResourceUri

The templateName as a String object.

Wiki Markup
{div:class=confluenceTableSmall} || Header || Description || | {{CamelVelocityResourceUri}} | The *templateName* as a {{String}} object. | {div}

Headers set during the Velocity evaluation are returned to the message and added as headers. Then its kinda possible to return values from Velocity to the Message.

...

Camel will provide exchange information in the Velocity context (just a Map). The Exchange is transfered as:

Div
classconfluenceTableSmall

key

value

exchange

The Exchange itself.

exchange.properties

The Exchange properties.

headers

The headers of the In message.

camelContext

The Camel Context intance.

request

The In message.

in

The In message.

body

The In message body.

out

The Out message (only for InOut message exchange pattern).

response

The Out message (only for InOut message exchange pattern).

Wiki Markup
{div:class=confluenceTableSmall} || key || value || | {{exchange}} | The {{Exchange}} itself. | | {{exchange.properties}} | The {{Exchange}} properties. | | {{headers}} | The headers of the In message. | | {{camelContext}} | The Camel Context intance. | | {{request}} | The In message. | | {{in}} | The In message. | | {{body}} | The In message body. | | {{out}} | The Out message (only for InOut message exchange pattern). | | {{response}} | The Out message (only for InOut message exchange pattern). | {div}

Since Camel-2.14, you can setup a custom Velocity Context yourself by setting the message header CamelVelocityContext just like this

...

Available as of Camel 2.1
Camel provides two headers by which you can define a different resource location for a template or the template content itself. If any of these headers is set then Camel uses this over the endpoint configured resource. This allows you to provide a dynamic template at runtime.

Div
classconfluenceTableSmall

Header

Type

Description

CamelVelocityResourceUri

String

Camel

Wiki Markup
{div:class=confluenceTableSmall} || Header || Type || Description || | CamelVelocityResourceUri | String | *Camel

2.1:

*

A

URI

for

the

template

resource

to

use

instead

of

the

endpoint

configured.

| | CamelVelocityTemplate | String | *Camel

CamelVelocityTemplate

String

Camel 2.1:

*

The

template

to

use

instead

of

the

endpoint

configured.

| {div}

Samples

For example you could use something like

...