You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Sam (Stephen Samuel)" <sa...@gmail.com> on 2012/11/01 10:34:21 UTC

Scala DSL Header

Hi all,

How can I get the value of a header from an exchange using the Scala
DSL. Maybe I'm going mad but

in.header("header-name")

 gives me a variable of type HeaderExpression or HeaderLanguage (can't
remember which) and I can't seem to get the "value" from that ?

Re: Scala DSL Header

Posted by "Sam (Stephen Samuel)" <sa...@gmail.com>.
exchange.in returns an Object, so there is no getHeader method
available on that.

There is an exchange.header but like I said it seems to return some
DSL construct that I can't figure out how to get the value out of.


On 1 November 2012 09:52, Willem jiang <wi...@gmail.com> wrote:
>
> in.getHeader("header-name") should work for you.
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
>           http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: willemjiang
>
>
>
>
>
> On Thursday, November 1, 2012 at 5:48 PM, Willem jiang wrote:
>
>> If you can access the exchange directly, you can use exchange.in (http://exchange.in)("header-key") to access the in message header.
>>
>>
>> --
>> Willem Jiang
>>
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Web: http://www.fusesource.com | http://www.redhat.com
>> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
>> http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
>> Twitter: willemjiang
>> Weibo: willemjiang
>>
>>
>>
>>
>>
>> On Thursday, November 1, 2012 at 5:34 PM, Sam (Stephen Samuel) wrote:
>>
>> > Hi all,
>> >
>> > How can I get the value of a header from an exchange using the Scala
>> > DSL. Maybe I'm going mad but
>> >
>> > in.header("header-name")
>> >
>> > gives me a variable of type HeaderExpression or HeaderLanguage (can't
>> > remember which) and I can't seem to get the "value" from that ?
>>
>
>
>



-- 
-Sam

Re: Scala DSL Header

Posted by Willem jiang <wi...@gmail.com>.
in.getHeader("header-name") should work for you.  

-- 
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang 
Weibo: willemjiang





On Thursday, November 1, 2012 at 5:48 PM, Willem jiang wrote:

> If you can access the exchange directly, you can use exchange.in (http://exchange.in)("header-key") to access the in message header.
> 
> 
> -- 
> Willem Jiang
> 
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
> http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang 
> Weibo: willemjiang
> 
> 
> 
> 
> 
> On Thursday, November 1, 2012 at 5:34 PM, Sam (Stephen Samuel) wrote:
> 
> > Hi all,
> > 
> > How can I get the value of a header from an exchange using the Scala
> > DSL. Maybe I'm going mad but
> > 
> > in.header("header-name")
> > 
> > gives me a variable of type HeaderExpression or HeaderLanguage (can't
> > remember which) and I can't seem to get the "value" from that ?
> 




Re: Scala DSL Header

Posted by Willem jiang <wi...@gmail.com>.
If you can access the exchange directly, you can use exchange.in("header-key") to access the in message header.


-- 
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang 
Weibo: willemjiang





On Thursday, November 1, 2012 at 5:34 PM, Sam (Stephen Samuel) wrote:

> Hi all,
> 
> How can I get the value of a header from an exchange using the Scala
> DSL. Maybe I'm going mad but
> 
> in.header("header-name")
> 
> gives me a variable of type HeaderExpression or HeaderLanguage (can't
> remember which) and I can't seem to get the "value" from that ?