camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonas Koperdraat <jo...@jonaskoperdraat.nl>
Subject Re: Access header in camel route
Date Wed, 05 Oct 2016 11:25:15 GMT
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 <hoidap08@gmail.com> 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-tp5788372.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message