I believe for the "to" routing, it's plain text... if you want to use a header 
value you need to use dynamic to:

http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html
http://www.davsclaus.com/2015/10/apache-camel-216-released-top-10.html

-Steve

> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On
> Behalf Of Jonas Koperdraat
> Sent: Wednesday, October 05, 2016 7:25 AM
> To: [email protected]
> Subject: Re: Access header in camel route
> 
> I believe the right way to access a header is either by using
> ${header.fieldname} or by using the @Header annotation.
> 
> See http://camel.apache.org/simple.html
> and http://camel.apache.org/parameter-binding-annotations.html for
> references.
> 
> Regards,
> 
> Jonas
> 
> On Wed, Oct 5, 2016 at 9:31 AM, axdz <[email protected]> wrote:
> > Hi all,
> >
> > I config a route in xml file
> >
> >                  *<route>
> >                         <from uri="activemq:test" />
> >                         <process ref="MyProcessor" />
> >                         <to uri="activemq:${in.header.fieldname}" />
> >
> >                 </route>*
> >
> > and here i MyProcessor class
> >    * public class MyProcessor implements Processor {
> >
> >     public void process(Exchange exchange) throws Exception {
> >         exchange.getIn().setHeader("fieldname", "valuename");
> >     }
> >
> > }*
> >
> > Above code can not show "valuename" by ${in.header.fieldname}.
> > Please give me some advice,
> > Thanks,
> >
> >
> >
> > --
> > View this message in context:
> > http://camel.465427.n5.nabble.com/Access-header-in-camel-route-
> tp57883
> > 72.html Sent from the Camel - Users mailing list archive at
> > Nabble.com.

Reply via email to