You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Bob Jolliffe <bo...@gmail.com> on 2013/07/29 10:25:50 UTC

Setting header with simple

I am trying to set the value of a header in a route like:

...
  <c:log message="${body.get('properties').get('Dhis2UID')}" />
  <c:setHeader headerName="uid"
><c:constant>${body.get('properties').get('Dhis2UID')}</c:constant></c:setHeader>
...

The log message displays the expected value.

But the header is being populated with the literal text
"${body.get('properties').get('Dhis2UID')}".

Any idea what I am doing wrong?

Regards
Bob

Re: Setting header with simple

Posted by Bob Jolliffe <bo...@gmail.com>.
Oops sorry I just solved it:
<c:setHeader headerName="uid"
><c:simple>${body.get('properties').get('Dhis2UID')}</c:simple></c:setHeader>

Constant is constant :-)


On 29 July 2013 09:34, Claus Ibsen <cl...@gmail.com> wrote:

> constant is 100% constant, eg exactly what you type.
>
> For dynamic values use a scripting language like simple, groovy etc
>
>
> On Mon, Jul 29, 2013 at 10:25 AM, Bob Jolliffe <bo...@gmail.com>
> wrote:
> > I am trying to set the value of a header in a route like:
> >
> > ...
> >   <c:log message="${body.get('properties').get('Dhis2UID')}" />
> >   <c:setHeader headerName="uid"
>
> >><c:constant>${body.get('properties').get('Dhis2UID')}</c:constant></c:setHeader>
> > ...
> >
> > The log message displays the expected value.
> >
> > But the header is being populated with the literal text
> > "${body.get('properties').get('Dhis2UID')}".
> >
> > Any idea what I am doing wrong?
> >
> > Regards
> > Bob
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>

Re: Setting header with simple

Posted by Claus Ibsen <cl...@gmail.com>.
constant is 100% constant, eg exactly what you type.

For dynamic values use a scripting language like simple, groovy etc


On Mon, Jul 29, 2013 at 10:25 AM, Bob Jolliffe <bo...@gmail.com> wrote:
> I am trying to set the value of a header in a route like:
>
> ...
>   <c:log message="${body.get('properties').get('Dhis2UID')}" />
>   <c:setHeader headerName="uid"
>><c:constant>${body.get('properties').get('Dhis2UID')}</c:constant></c:setHeader>
> ...
>
> The log message displays the expected value.
>
> But the header is being populated with the literal text
> "${body.get('properties').get('Dhis2UID')}".
>
> Any idea what I am doing wrong?
>
> Regards
> Bob



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen