camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rasmus Larsen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-7638) Use response input stream directly in http producer
Date Mon, 18 May 2015 09:32:03 GMT

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

Rasmus Larsen commented on CAMEL-7638:
--------------------------------------

I tried to use disableStream on the consumer:

<from uri="jetty:http://0.0.0.0:{{jetty.port}}/dawa?matchOnUriPrefix=true&amp;continuationTimeout=3600000&amp;disableStreamCache=true"
/>
<to uri="jetty:{{real-endpoint-base-url}}?bridgeEndpoint=true&amp;throwExceptionOnFailure=false&amp;httpClient.timeout=3600000"
/>

But I am getting the same error:

org.apache.camel.CamelExchangeException: JettyClient failed cause by: Java heap space. Exchange[Message:
[Body is null]]. Caused by: [java.lang.OutOfMemoryError - Java heap space]
	at org.apache.camel.component.jetty.JettyContentExchange.doTaskCompleted(JettyContentExchange.java:223)[237:org.apache.camel.camel-jetty:2.14.1]
	at org.apache.camel.component.jetty.JettyContentExchange.onException(JettyContentExchange.java:143)[237:org.apache.camel.camel-jetty:2.14.1]
	at org.eclipse.jetty.client.HttpExchange$Listener.onException(HttpExchange.java:1108)[73:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
	at org.eclipse.jetty.client.AsyncHttpConnection.handle(AsyncHttpConnection.java:168)[73:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)[73:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)[73:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[73:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[73:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
	at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
Caused by: java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOf(Arrays.java:2271)[:1.7.0_51]
	at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:113)[:1.7.0_51]
	at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)[:1.7.0_51]
	at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:140)[:1.7.0_51]
	at org.eclipse.jetty.io.AbstractBuffer.writeTo(AbstractBuffer.java:689)[73:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
	at org.eclipse.jetty.client.ContentExchange.onResponseContent(ContentExchange.java:105)[73:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
	at org.eclipse.jetty.client.HttpExchange$Listener.onResponseContent(HttpExchange.java:1177)[73:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
	at org.eclipse.jetty.client.AbstractHttpConnection$Handler.content(AbstractHttpConnection.java:332)[73:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:957)[73:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)[73:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
	at org.eclipse.jetty.client.AsyncHttpConnection.handle(AsyncHttpConnection.java:135)[73:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
	... 5 more


If I try to set disableStreamCache=true on the producer, the proxy does not work. It appears
to strip the url. 
If for example, I try to reach http://example.com/somepart, then I get content from http://example.com


> 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)

Mime
View raw message