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/97f984cc
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/97f984cc
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/97f984cc

Branch: refs/heads/camel-2.12.x
Commit: 97f984cc81f9e5ddeba423e73da803221acdeb84
Parents: 2c97542
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:50 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/97f984cc/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/97f984cc/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 509ea02..c18c9b4 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;
+    }
+
 }

Reply via email to