Details
-
Bug
-
Resolution: Not a Bug
-
Major
-
fuse-7.5-GA
-
None
-
%
Description
It is not possible to disable chunking on camel-http4 producer endpoint. Here is a simple camel route:
<route> <from uri="timer://test?delay=2s&repeatCount=1"/> <process ref="setStreamToBodyProcessor"/> <to uri="http4://localhost:8001/rest/test?bridgeEndpoint=true&throwExceptionOnFailure=false&chunked=false"/> </route>
I am not only set option "chunked=false" to the camel-http4 producer endpoint URI, but also invoked the following code to explicitly set header "CamelHttpChunked" to false:
exchange.getIn().setHeader(Exchange.HTTP_CHUNKED, false);
However, the data sent to the server side from the camel-http4 producer endpoint was always chunked.
When directly using Httpcomponents-client V4.5 API, it is possible to disable chunking. for instance, this example:
https://github.com/apache/httpcomponents-client/blob/4.5.x/httpclient/src/examples/org/apache/http/examples/client/ClientChunkEncodedPost.java
When modify the line #58 to
reqEntity.setChunked(false);
Then it is possible to disable chunking.