LibraryToggle FramesPrintFeedback

Available as of Fuse Mediation Router 1.6

The freemarker: component allows you to process a message using a Freemarker template. This can be ideal when using Templating to generate responses for requests.

Maven users will need to add the following dependency to their pom.xml for this component:

    <!-- use the same version as your Camel core version -->

Option Default Description
contentCache true Cache for the resource content when its loaded.
encoding null Character encoding of the resource content.

Fuse Mediation Router will provide exchange information in the Freemarker context (just a Map). The Exchange is transfered as:

Key Value
exchange The Exchange itself.
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).

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.

Header Type Description
CamelFreemarkerResourceUri String Camel 2.1: A URI for the template resource to use instead of the endpoint configured.
CamelFreemarkerTemplate String Camel 2.1: The template to use instead of the endpoint configured.
Comments powered by Disqus