You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Martin Krasser <de...@martin-krasser.de> on 2009/05/27 14:59:15 UTC

DefaultHttpBinding prevents response streaming

The new DefaultHttpBinding implementation in Camel 1.6.1 (after a patch 
from CAMEL-1327) doesn't support streaming of large content with the 
http response any more. If the out message of an exchange contains an 
input stream it is read into memory (before it is written to the servlet 
output stream). This is done inside the doWriteResponse() method. 
Depending on the size of the stream this might result in an 
OutOfMemoryError. Reading a response stream into memory should only be 
done if a GZIP content encoding is explicitly requested, otherwise it 
should be written to the servlet output stream directly. Is this an 
issue or do I miss something?

Cheers,
Martin



Re: DefaultHttpBinding prevents response streaming

Posted by Willem Jiang <wi...@gmail.com>.
Hi Martin,

Current camel-http solution has this issue which you side.
Please feel free to create a JIRA[1] for it.

[1] https://issues.apache.org/activemq/browse/CAMEL

Willem

Martin Krasser wrote:
> The new DefaultHttpBinding implementation in Camel 1.6.1 (after a patch
> from CAMEL-1327) doesn't support streaming of large content with the
> http response any more. If the out message of an exchange contains an
> input stream it is read into memory (before it is written to the servlet
> output stream). This is done inside the doWriteResponse() method.
> Depending on the size of the stream this might result in an
> OutOfMemoryError. Reading a response stream into memory should only be
> done if a GZIP content encoding is explicitly requested, otherwise it
> should be written to the servlet output stream directly. Is this an
> issue or do I miss something?
> 
> Cheers,
> Martin
> 
> 
>