Hi

Welcome to the Camel community.

The EIP patterns has the recipient list as the solution for "dynamic to"
http://camel.apache.org/recipient-list.html

Then you can use any Camel expression to compute the dynamic uri such
as the Simple language
http://camel.apache.org/simple

.recipientList(simple("freemarker://templateHome/${body.templateName}.ftl"));

But you can also use Groovy or whatever you like
http://camel.apache.org/languages.html


On Fri, Mar 11, 2011 at 8:27 PM,  <[email protected]> wrote:
> Hi all,
>
> I'm new to Camel and already searched the mailling list for this issue but 
> couldn't find a solution for JavaDSL.
>
> I'd like to build a "to" URI dynamically from a value coming from the body. 
> More concrete: I'd like to load a FreeMarker template depending on a body 
> value. I've tried this:
>
> to("freemarker://templateHome/${body.templateName}.ftl")
>
> It seems that the URI is not evaluated.
> I also tried this:
>
> to("freemarker://templateHome" + simple("${body.templateName}) + ".ftl")
>
> But both seems not to work. Am I missing something or did I something get 
> wrong with the simple syntax usage?
>
> Thanks in advance.
>
> Best regards
> Stephan
> --
> Schon gehört? GMX hat einen genialen Phishing-Filter in die
> Toolbar eingebaut! http://www.gmx.net/de/go/toolbar
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to