-
Bug
-
Resolution: Cannot Reproduce
-
Major
-
None
-
None
-
None
We have an early adopter who is trying to use camel-netty feature in 2.12 and we are unable to set the headers properly, i.e:
<!-- ROUTE 2 -->
<route id="route2">
<from uri="netty-http:http://localhost:5103/test"/>
<log message="*** HERE In customer test ... "/>
<to uri="log:fusesource.com?showHeaders=true"/>
<log message="*** Returning customer test ... "/>
<to uri="mock:result"/>
</route>
<!-- ROUTE 1 -->
<route id="route1">
<from uri="timer://foo?repeatCount=1"/>
<setBody>
<method ref="helloBean" method="hello"/>
</setBody>
<setHeader headerName="Date">
<simple>${date:now:yyyy-MM-dd}</simple>
</setHeader>
<log message="The message contains ${body}"/>
<to uri="log:fusesource.com?showHeaders=true"/>
<!--to uri="log:fusesource.com?showHeaders=true"/-->
<to uri="netty-http:http://localhost:5103/test?transferExchange=true"/>
<log message="*** Returning customer test "/>
</route>
In this route, I can see my date header on the outgoing request:
[EventDrivenConsumerRoute[Endpoint[timer://foo?repeatCount=1] -> Pipeline[[Channel[SetBody(BeanExpression[ method: hello])], Channel[setHeader(Date, Simple: ${date:now:yyyy-MM-dd})], Channel[Log(imgateway_outgoing_osgi)[The message contains ${body}]], Channel[sendTo(Endpoint[log://fusesource.com?showHeaders=true])], Channel[sendTo(Endpoint[http://localhost:5103/test])], Channel[Log(imgateway_outgoing_osgi)[*** Returning customer test ]]]]]
But on the receiving side, my header is gone:
ead #10 - NettyServerTCPWorker] com INFO Exchange[ExchangePattern: InOut, Headers: {breadcrumbId=ID-wildflower-55372-1386265283836-0-1, CamelHttpMethod=POST, CamelHttpPath=, CamelHttpQuery=null, CamelHttpUri=/test, CamelHttpUrl=http://localhost:5103/test, CamelNettyChannelHandlerContext=org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext@2c5a1e6b, CamelNettyLocalAddress=/127.0.0.1:5103, CamelNettyMessageEvent=[id: 0xf64f9f94, /127.0.0.1:55377 => /127.0.0.1:5103] RECEIVED: DefaultHttpRequest(chunked: false) POST http://localhost:5103/test HTTP/1.1 breadcrumbId: ID-wildflower-55372-1386265283836-0-1 firedTime: Thu Dec 05 12:41:31 EST 2013 Content-Length: 36 Host: localhost Connection: keep-alive, CamelNettyRemoteAddress=/127.0.0.1:55377, Connection=keep-alive, Content-Length=36, firedTime=Thu Dec 05 12:41:31 EST 2013, Host=localhost}, BodyType: org.apache.camel.component.netty.http.NettyChannelBufferStreamCache, Body: [Body is instance of org.apache.camel.StreamCache]]
I see we have an option for TCP to transfer the exchange but not for HTTP. Is there a way to do this?