[ 
https://issues.apache.org/jira/browse/CAMEL-7638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14550064#comment-14550064
 ] 

Ralf Steppacher commented on CAMEL-7638:
----------------------------------------

[[email protected]], setting {{disableStreamCache=true}} only effects 
the http consumers, but not the procuders.

All http producers that I am aware of (Jetty, http4, netty-http) read the 
response stream into a byte-array, wrap it in an InputStream and place that in 
the exchange body. Thus a large http response blows a proxy route out of the 
water. None of the producers seem to offer an option to make them put the 
original socket input stream into the exchange.

{{http4}}: Everything happens in 
org.apache.camel.component.http4.HttpProducer::process() -> 
populateResponse(..) -> extractResponseBody(..) -> 
doExtractResponseBodyAsStream(); here the original stream is copied into an 
instance of CachedOutputStream, backed by a byte-array.

{{Jetty}}: org.eclipse.jetty.client.AsyncHttpConnection::handle() -> 
org.eclipse.jetty.http.HttpParser::parseNext() will fill a byte-array in 
org.eclipse.jetty.client.ContentExchange which is a CachedExchange which is a 
HttpExchange.

{{netty-http}}: Builds a pipeline that assembles the HttpResponse content as a 
composite ChannelBuffer. The wrapped channel buffers make up the complete 
response stream. 

> Use response input stream directly in http producer
> ---------------------------------------------------
>
>                 Key: CAMEL-7638
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7638
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Willem Jiang
>            Assignee: Willem Jiang
>
> It could save us lots of the memory and time if the response is a big and 
> chunked message.
> Here are some discussion in the mailing list about it.
> http://camel.465427.n5.nabble.com/Stream-only-reverse-proxy-with-minimal-memory-footprint-tp5754424.html
>  
> http://camel.465427.n5.nabble.com/Chunking-issue-with-http-producer-td5735075.html
>  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to