[
https://issues.apache.org/jira/browse/CAMEL-10577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15814388#comment-15814388
]
ASF GitHub Bot commented on CAMEL-10577:
----------------------------------------
GitHub user kevinearls opened a pull request:
https://github.com/apache/camel/pull/1388
CAMEL-10577 replace BufferingResponseListener with InputStreamRespons…
…eListener to avoid hardcoded 2MB limit
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/kevinearls/camel CAMEL-10577
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/1388.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1388
----
commit 41cd808b813d0919dea28c31851c1eb056310e82
Author: Kevin Earls <[email protected]>
Date: 2017-01-10T08:56:40Z
CAMEL-10577 replace BufferingResponseListener with
InputStreamResponseListener to avoid hardcoded 2MB limit
----
> Jetty9 producer only supports payloads up hardcoded limit (2MB)
> ---------------------------------------------------------------
>
> Key: CAMEL-10577
> URL: https://issues.apache.org/jira/browse/CAMEL-10577
> Project: Camel
> Issue Type: Improvement
> Components: camel-jetty
> Reporter: Christoph Läubrich
> Fix For: 2.19.0
>
>
> Camel-Jetty9 uses
> [BufferingResponseListener|http://download.eclipse.org/jetty/9.3.12.v20160915/apidocs/org/eclipse/jetty/client/util/BufferingResponseListener.html]
> without any arguments when retriving content from URLs.
> This leads to the problem that you can retrive a maximum of 2MiB from a
> server, e.g. the following code{noformat}public void configure() throws
> Exception {
> from("timer://test?repeatCount=1")
> .log("Start download...")
>
> .to("jetty:http://mirror.netcologne.de/apache.org/camel/apache-camel/2.18.1/apache-camel-2.18.1.zip")
> .log("Download done!");
> }{noformat}
> leads to
> {noformat}org.apache.camel.CamelExchangeException: JettyClient failed cause
> by: Buffering capacity exceeded.
> Exchange[ID-laeubi4core-60072-1481204922807-0-2]. Caused by:
> [java.lang.IllegalArgumentException - Buffering capacity exceeded]
> at
> org.apache.camel.component.jetty9.JettyContentExchange9.doTaskCompleted(JettyContentExchange9.java:156)
> at
> org.apache.camel.component.jetty9.JettyContentExchange9$2.onComplete(JettyContentExchange9.java:222)
> at
> org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:193)
> at
> org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:185)
> at
> org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:456)
> at
> org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:437)
> at
> org.eclipse.jetty.client.HttpReceiver.responseHeaders(HttpReceiver.java:280)
> at
> org.eclipse.jetty.client.http.HttpReceiverOverHTTP.headerComplete(HttpReceiverOverHTTP.java:230)
> at org.eclipse.jetty.http.HttpParser.parseHeaders(HttpParser.java:1038)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1266)
> at
> org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:158)
> at
> org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:119)
> at
> org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:69)
> at
> org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:90)
> at
> org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:114)
> at
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
> at
> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
> at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
> at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.IllegalArgumentException: Buffering capacity exceeded
> at
> org.eclipse.jetty.client.util.BufferingResponseListener.onHeaders(BufferingResponseListener.java:75)
> at
> org.eclipse.jetty.client.ResponseNotifier.notifyHeaders(ResponseNotifier.java:103)
> at
> org.eclipse.jetty.client.ResponseNotifier.notifyHeaders(ResponseNotifier.java:95)
> at
> org.eclipse.jetty.client.HttpReceiver.responseHeaders(HttpReceiver.java:259)
> ... 16 more{noformat}
> The maximum size should at least be configurable (even though it is not
> recommended to do so since it seem to reserve the full buffer space on each
> request then).
> It might be even better to use
> [InputStreamResponseListener|http://download.eclipse.org/jetty/9.3.12.v20160915/apidocs/org/eclipse/jetty/client/util/InputStreamResponseListener.html]
> instead to place an input stream in the body.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)