Hi,

Does the header "name" value is String?
If it is not , you'd better to convert it to a String.


-- 
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 Tuesday, November 27, 2012 at 4:21 AM, dunnlow wrote:

> (a simplification of an earlier question - I'm using camel 10.0, spring 3.1)
> 
> Can someone tell me how, *using Spring DSL*, to set the message body to the
> size of the message header named "name"? I don't care if it's simple, or a
> different script language (I can't get any to work). 
> 
> Something like this -- but this doesn't work:
> 
> <camel:setBody>
> 
> <camel:javaScript>request.headers.get('name').length</camel:javaScript>
> </camel:setBody>
> 
> I am able to verify the header exists and stream it to standard out just
> fine, but trying to get the length throws a variety of exceptions depending
> on the method/language I try.
> 
> Thanks very much!
> -J
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Set-body-to-length-of-header-string-in-Spring-DSL-tp5723258.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).



Reply via email to