Hi, I'm a newbie to Camel and I'm currently evaluating the product.

I am reading through the 
http://camel.apache.org/tutorial-example-reportincident-part5.html
ReportIncident tutorial  and I see the following example:

from(cxfEndpoint)
   .setHeader(FileComponent.HEADER_FILE_NAME,
BeanLanguage.bean(FilenameGenerator.class,"generateFilename"))
   .to("velocity:MailBody.vm")
   .to("file://target/subfolder");

The bit I am having troubles with is setting a header which I assume is then
used by the file endpoint.

I would have thought it would be better to pass some context to the file
endpoint as follows:

from(cxfEndpoint)
   .to("velocity:MailBody.vm")
   .to("file://target/subfolder", new FilenameGenerator());

Is this practice of setting headers common in Camel? I feel it's a bit
hacky.

Thanks in advance,
Lance.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Passing-parameters-as-headers-feels-a-bit-hacky-tp5678320.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to