You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Desu, Kishore Kumar" <Ki...@McKesson.com> on 2015/01/16 10:19:50 UTC

camel 2.14.1 rest component - read headers

Hi,

I am trying to read request headers using Apache camel 2.14.1 "Rest" component. Below is my spring dsl to configure rest component. I am using restlet as my endpoint.
<rest path="/a">
            <get uri="/{b}">
                <route>
                    <setBody>
                        <simple>${header.b}:${header.headerName}</simple>
                    </setBody>
                    <to uri="activemq:queue:requestQueue?replyTo=responseQueue"/>
                </route>
            </get>
</rest>

My restlet configuration is,
<bean id="RestletComponent" class="org.restlet.Component" />
      <bean id="RestletComponentService" class="org.apache.camel.component.restlet.RestletComponent">
        <constructor-arg ref="RestletComponent" />
</bean>

When I call this service(http//localhost:8081/test/a/b) by setting the headers (headerName=1) using postman plugin, then my camel configuration is unable to read header values.
As per the documentation, we can read headers using ${in.header.headerName}, which is returning empty.
Please help me to read header values in my case.
Thanks,
Kishore Kumar Desu.