...
You can append query options to the URI in the following format, ?option=value&option=value&...
Options
| Div |
|---|
| class | confluenceTableSmall |
|---|
|
Option | Default | Description |
|---|
contentCache | true | Cache for the resource content when it's 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. | templateUpdateDelay | 5 | Camel 2.9: Number of seconds the loaded template resource will remain in the cache. |
|
| Wiki Markup |
|---|
| {div:class=confluenceTableSmall}
|| Option || Default || Description ||
| {{contentCache}} | {{true}} | Cache for the resource content when it's 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. |
| {{templateUpdateDelay}} | {{5}} | *Camel 2.9:* Number of seconds the loaded template resource will remain in the cache. |
{div} |
Headers set during the FreeMarker evaluation are returned to the message and added as headers. This provides a mechanism for the FreeMarker component to return values to the Message.
...
Camel will provide exchange information in the FreeMarker context (just a Map). The Exchange is transferred as:
| 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. | request | The In message. | body | The In message body. | 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. |
| {{request}} | The In message. |
| {{body}} | The In message body. |
| {{response}} | The Out message (only for InOut message exchange pattern). |
{div} |
From Camel 2.14, you can setup your custom FreeMarker context in the message header with the key "CamelFreemarkerDataModel" just like this
...
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 |
|---|
| class | confluenceTableSmall |
|---|
|
| Wiki Markup |
|---|
{div:class=confluenceTableSmall}
|| Header || Type || Description || Support Version ||
| Header | Type | Description | Support Version |
|---|
FreemarkerConstants.FREEMARKER_RESOURCE |
| | org.springframework.core.io.Resource |
| | |
| | FreemarkerConstants.FREEMARKER_RESOURCE_URI |
| String | A URI for the template resource to use instead of the endpoint configured. | >= 2.1 |
| | String | A URI for the template resource to use instead of the endpoint configured. | >= 2.1 | FreemarkerConstants.FREEMARKER_TEMPLATE |
| String | The template to use instead of the endpoint configured. | >= 2.1 |
{div} | String | The template to use instead of the endpoint configured. | >= 2.1 |
|
Samples
For example you could use something like:
...