Repository: camel Updated Branches: refs/heads/camel-2.12.x 2c97542d4 -> 97f984cc8 refs/heads/camel-2.13.x 31cfd8aef -> be3f66696
CAMEL-7593: camel-netty-http consumer should allow to configure the chunked http size as it was hardcoded to 1mb. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/be3f6669 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/be3f6669 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/be3f6669 Branch: refs/heads/camel-2.13.x Commit: be3f66696968983053367aa68e8b7834f36cf9ec Parents: 31cfd8a Author: Claus Ibsen <davscl...@apache.org> Authored: Fri Jul 11 11:05:15 2014 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Fri Jul 11 11:05:35 2014 +0200 ---------------------------------------------------------------------- .../netty/http/HttpServerPipelineFactory.java | 4 ++-- .../netty/http/NettyHttpConfiguration.java | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/be3f6669/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpServerPipelineFactory.java ---------------------------------------------------------------------- diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpServerPipelineFactory.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpServerPipelineFactory.java index 2ae1794..5d705ad 100644 --- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpServerPipelineFactory.java +++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpServerPipelineFactory.java @@ -45,7 +45,7 @@ public class HttpServerPipelineFactory extends ServerPipelineFactory { private static final Logger LOG = LoggerFactory.getLogger(HttpServerPipelineFactory.class); protected NettyHttpConsumer consumer; protected SSLContext sslContext; - protected NettyServerBootstrapConfiguration configuration; + protected NettyHttpConfiguration configuration; public HttpServerPipelineFactory() { // default constructor needed @@ -84,7 +84,7 @@ public class HttpServerPipelineFactory extends ServerPipelineFactory { } pipeline.addLast("decoder", new HttpRequestDecoder()); - pipeline.addLast("aggregator", new HttpChunkAggregator(1048576)); + pipeline.addLast("aggregator", new HttpChunkAggregator(configuration.getChunkedMaxContentLength())); pipeline.addLast("encoder", new HttpResponseEncoder()); if (supportCompressed()) { http://git-wip-us.apache.org/repos/asf/camel/blob/be3f6669/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java index e4f37b4..420a448 100644 --- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java +++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java @@ -38,6 +38,8 @@ public class NettyHttpConfiguration extends NettyConfiguration { private String path; private boolean disableStreamCache; private boolean send503whenSuspended = true; + private int chunkedMaxContentLength = 1024 * 1024; + private boolean chunked = true; public NettyHttpConfiguration() { // we need sync=true as http is request/reply by nature @@ -142,4 +144,21 @@ public class NettyHttpConfiguration extends NettyConfiguration { public void setSend503whenSuspended(boolean send503whenSuspended) { this.send503whenSuspended = send503whenSuspended; } + + public boolean isChunked() { + return chunked; + } + + public void setChunked(boolean chunked) { + this.chunked = chunked; + } + + public int getChunkedMaxContentLength() { + return chunkedMaxContentLength; + } + + public void setChunkedMaxContentLength(int chunkedMaxContentLength) { + this.chunkedMaxContentLength = chunkedMaxContentLength; + } + }