You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2014/10/24 09:03:06 UTC
[3/3] git commit: CAMEL-7848 Need to added the encode and decode
after the http codec in camel-netty4-http
CAMEL-7848 Need to added the encode and decode after the http codec in camel-netty4-http
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5886d8f2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5886d8f2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5886d8f2
Branch: refs/heads/camel-2.14.x
Commit: 5886d8f276e01072524ffa02ce9ca950db9fa253
Parents: 21f37e1
Author: Willem Jiang <wi...@gmail.com>
Authored: Fri Oct 24 14:33:05 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Oct 24 15:02:36 2014 +0800
----------------------------------------------------------------------
components/camel-netty4-http/pom.xml | 14 ++++++++++----
.../netty4/http/HttpClientInitializerFactory.java | 4 ++--
.../netty4/http/HttpServerInitializerFactory.java | 10 ++++------
parent/pom.xml | 1 +
4 files changed, 17 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/5886d8f2/components/camel-netty4-http/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/pom.xml b/components/camel-netty4-http/pom.xml
index bd44ef0..1026fba 100644
--- a/components/camel-netty4-http/pom.xml
+++ b/components/camel-netty4-http/pom.xml
@@ -41,13 +41,19 @@
<artifactId>camel-netty4</artifactId>
</dependency>
<dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-codec-http</artifactId>
- <version>${netty-version}</version>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-codec-http</artifactId>
+ <version>${netty-version}</version>
</dependency>
-
+
<!-- testing -->
<dependency>
+ <groupId>com.jcraft</groupId>
+ <artifactId>jzlib</artifactId>
+ <version>${jzlib-version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-spring</artifactId>
<scope>test</scope>
http://git-wip-us.apache.org/repos/asf/camel/blob/5886d8f2/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/HttpClientInitializerFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/HttpClientInitializerFactory.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/HttpClientInitializerFactory.java
index b19fcf1..bda2f9e 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/HttpClientInitializerFactory.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/HttpClientInitializerFactory.java
@@ -85,6 +85,8 @@ public class HttpClientInitializerFactory extends ClientInitializerFactory {
pipeline.addLast("ssl", sslHandler);
}
+ pipeline.addLast("http", new HttpClientCodec());
+
List<ChannelHandler> encoders = producer.getConfiguration().getEncoders();
for (int x = 0; x < encoders.size(); x++) {
ChannelHandler encoder = encoders.get(x);
@@ -104,8 +106,6 @@ public class HttpClientInitializerFactory extends ClientInitializerFactory {
}
pipeline.addLast("decoder-" + x, decoder);
}
-
- pipeline.addLast("http", new HttpClientCodec());
pipeline.addLast("aggregator", new HttpObjectAggregator(configuration.getChunkedMaxContentLength()));
if (producer.getConfiguration().getRequestTimeout() > 0) {
http://git-wip-us.apache.org/repos/asf/camel/blob/5886d8f2/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/HttpServerInitializerFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/HttpServerInitializerFactory.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/HttpServerInitializerFactory.java
index 6d61945..c7f40ea 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/HttpServerInitializerFactory.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/HttpServerInitializerFactory.java
@@ -87,6 +87,7 @@ public class HttpServerInitializerFactory extends ServerInitializerFactory {
pipeline.addLast("ssl", sslHandler);
}
+ pipeline.addLast("decoder", new HttpRequestDecoder());
List<ChannelHandler> decoders = consumer.getConfiguration().getDecoders();
for (int x = 0; x < decoders.size(); x++) {
ChannelHandler decoder = decoders.get(x);
@@ -96,7 +97,9 @@ public class HttpServerInitializerFactory extends ServerInitializerFactory {
}
pipeline.addLast("decoder-" + x, decoder);
}
-
+ pipeline.addLast("aggregator", new HttpObjectAggregator(configuration.getChunkedMaxContentLength()));
+
+ pipeline.addLast("encoder", new HttpResponseEncoder());
List<ChannelHandler> encoders = consumer.getConfiguration().getEncoders();
for (int x = 0; x < encoders.size(); x++) {
ChannelHandler encoder = encoders.get(x);
@@ -106,11 +109,6 @@ public class HttpServerInitializerFactory extends ServerInitializerFactory {
}
pipeline.addLast("encoder-" + x, encoder);
}
-
- pipeline.addLast("decoder", new HttpRequestDecoder());
- pipeline.addLast("aggregator", new HttpObjectAggregator(configuration.getChunkedMaxContentLength()));
-
- pipeline.addLast("encoder", new HttpResponseEncoder());
if (supportCompressed()) {
pipeline.addLast("deflater", new HttpContentCompressor());
}
http://git-wip-us.apache.org/repos/asf/camel/blob/5886d8f2/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 5b513d5..a51f3cb 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -272,6 +272,7 @@
<junit-bundle-version>4.11_1</junit-bundle-version>
<junit-version>4.11</junit-version>
<jython-version>2.5.3</jython-version>
+ <jzlib-version>1.1.3</jzlib-version>
<kafka-version>0.8.1</kafka-version>
<kafka-bundle-version>0.8.1_1</kafka-bundle-version>
<karaf-version>2.3.7</karaf-version>