Samples - 6.3

Talend ESB Mediation Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend ESB

For example you could use something like:

from("activemq:My.Queue")
   .to("freemarker:com/acme/MyResponse.ftl");

to use a FreeMarker template to formulate a response for a message for InOut message exchanges (where there is a JMSReplyTo header).

If you want to use InOnly and consume the message and send it to another destination you could use:

from("activemq:My.Queue")
   .to("freemarker:com/acme/MyResponse.ftl")
   .to("activemq:Another.Queue");

To disable the content cache, for example, for development usage where the .ftl template should be hot reloaded:

from("activemq:My.Queue")
   .to("freemarker:com/acme/MyResponse.ftl?contentCache=false")
   .to("activemq:Another.Queue");

A file-based resource:

from("activemq:My.Queue")
   .to("freemarker:file://myfolder/MyResponse.ftl?contentCache=false")
   .to("activemq:Another.Queue");

In it is possible to specify what template the component should use dynamically via a header, so for example:

from("direct:in").setHeader(FreemarkerConstants.FREEMARKER_RESOURCE_URI).
          constant("path/to/my/template.ftl").to("freemarker:dummy");