LibraryToggle FramesPrintFeedback

The scalate: component allows you to process a message using Scalate template, which supports either SSP or Scaml format templates. 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:

<dependency>
    <groupId>org.fusesource.scalate</groupId>
    <artifactId>scalate-camel</artifactId>
    <version>1.0</version>
</dependency>

Apache Camel will provide exchange information in the Scalate 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 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).

Apache 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 Apache Camel uses this over the endpoint configured resource. This allows you to provide a dynamic template at runtime.

Header Type Description
CamelScalateResourceUri String An URI for the template resource to use instead of the endpoint configured.
CamelScalateTemplate String The template to use instead of the endpoint configured.
Comments powered by Disqus