Re: Set header from velocity template

2014-04-15 Thread Willem Jiang
As the message header could be override or lost in the processor. My suggest is put the old message body into exchange property. Camel is copying the exchange properties by default. -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http:/

Re: Set header from velocity template

2014-04-15 Thread dunnlow
ah! Thank you, works as expected: ${body} ${body} headers.currentBody ...albeit not as clean as a "toHeader" option on the velocity component :) -- View this message in context: http://camel.465427.n5.nabble.com/Set-header-using-velocity-template-tp5750248p5750271.html

Re: Set header from velocity template

2014-04-15 Thread Bilgin Ibryam
Velocity will put the result of the evaluation in the message body, you cannot change that. But you could preserve the existing body by putting it into a header before calling velocity template, and then swap the template result with the previous body afterwards... HTH On 15 April 2014 18:13, d

Re: Set header from velocity template

2014-04-15 Thread dunnlow
Sorry, I should have given more detail. I am using velocity to create web pages. My template is an html formatted document (about 40 lines) that uses existing exchange headers. (This gets turned into a web page downstream.) In my (xml) route I have something like: However, this puts

Re: Set header from velocity template

2014-04-15 Thread Bilgin Ibryam
Have you read the documentation and tried the example? $in.setHeader('fruit', 'orange') http://camel.apache.org/velocity.html On 15 April 2014 15:52, dunnlow wrote: > I currently use velocity to set the message body. Now, I would like to use > it to set a _header_. I haven't found any ex