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 2015/05/31 05:11:37 UTC
[1/2] camel git commit: CAMEL-8821 merged the patch into camel-http4
Repository: camel
Updated Branches:
refs/heads/master be73f1aa8 -> c5254616b
CAMEL-8821 merged the patch into camel-http4
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c5254616
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c5254616
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c5254616
Branch: refs/heads/master
Commit: c5254616bd76547b74257500069a95b560d8db61
Parents: 23a07e5
Author: Willem Jiang <wi...@gmail.com>
Authored: Sun May 31 11:10:58 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Sun May 31 11:11:26 2015 +0800
----------------------------------------------------------------------
.../camel/component/http4/DefaultHttpBinding.java | 2 +-
.../apache/camel/component/http4/helper/HttpHelper.java | 12 ++++++++++--
2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/c5254616/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
index f94a3c1..c7a9e2c 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
@@ -420,7 +420,7 @@ public class DefaultHttpBinding implements HttpBinding {
return null;
}
}
- // reade the response body from servlet request
+ // read the response body from servlet request
return HttpHelper.readResponseBodyFromServletRequest(request, httpMessage.getExchange());
}
}
http://git-wip-us.apache.org/repos/asf/camel/blob/c5254616/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java
index 82c4fd9..4201ed9 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java
@@ -41,6 +41,7 @@ import org.apache.camel.component.http4.HttpMessage;
import org.apache.camel.component.http4.HttpMethods;
import org.apache.camel.component.http4.HttpServletUrlRewrite;
import org.apache.camel.converter.stream.CachedOutputStream;
+import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.util.CamelObjectInputStream;
import org.apache.camel.util.IOHelper;
import org.apache.camel.util.ObjectHelper;
@@ -163,9 +164,16 @@ public final class HttpHelper {
if (is == null) {
return null;
}
-
+
+ boolean disableStreamCaching = false;
+ // Just take the consideration of the setting of Camel Context StreamCaching
+ if (exchange.getContext() instanceof DefaultCamelContext) {
+ DefaultCamelContext context = (DefaultCamelContext) exchange.getContext();
+ disableStreamCaching = !context.isStreamCaching();
+ }
+
// convert the input stream to StreamCache if the stream cache is not disabled
- if (exchange.getProperty(Exchange.DISABLE_HTTP_STREAM_CACHE, Boolean.FALSE, Boolean.class)) {
+ if (exchange.getProperty(Exchange.DISABLE_HTTP_STREAM_CACHE, disableStreamCaching, Boolean.class)) {
return is;
} else {
CachedOutputStream cos = new CachedOutputStream(exchange);
[2/2] camel git commit: CAMEL-8821 Support to disable the stream
caching in camel-servlet from the camel context
Posted by ni...@apache.org.
CAMEL-8821 Support to disable the stream caching in camel-servlet from the camel context
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/23a07e5f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/23a07e5f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/23a07e5f
Branch: refs/heads/master
Commit: 23a07e5fed5e1183be9d046c5e298ee75cc152ab
Parents: be73f1a
Author: Willem Jiang <wi...@gmail.com>
Authored: Sun May 31 11:10:42 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Sun May 31 11:11:26 2015 +0800
----------------------------------------------------------------------
.../apache/camel/component/http/DefaultHttpBinding.java | 2 +-
.../apache/camel/component/http/helper/HttpHelper.java | 10 ++++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/23a07e5f/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java
----------------------------------------------------------------------
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java b/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java
index 6617f70..97c81c0 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java
@@ -457,7 +457,7 @@ public class DefaultHttpBinding implements HttpBinding {
return null;
}
}
- // reade the response body from servlet request
+ // read the response body from servlet request
return HttpHelper.readResponseBodyFromServletRequest(request, httpMessage.getExchange());
}
}
http://git-wip-us.apache.org/repos/asf/camel/blob/23a07e5f/components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpHelper.java
----------------------------------------------------------------------
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpHelper.java b/components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpHelper.java
index c7cce00..edee4b4 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpHelper.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpHelper.java
@@ -42,6 +42,7 @@ import org.apache.camel.component.http.HttpMethods;
import org.apache.camel.component.http.HttpServletUrlRewrite;
import org.apache.camel.converter.IOConverter;
import org.apache.camel.converter.stream.CachedOutputStream;
+import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.util.CamelObjectInputStream;
import org.apache.camel.util.IOHelper;
import org.apache.camel.util.ObjectHelper;
@@ -179,9 +180,14 @@ public final class HttpHelper {
if (is == null) {
return null;
}
-
+ boolean disableStreamCaching = false;
+ // Just take the consideration of the setting of Camel Context StreamCaching
+ if (exchange.getContext() instanceof DefaultCamelContext) {
+ DefaultCamelContext context = (DefaultCamelContext) exchange.getContext();
+ disableStreamCaching = !context.isStreamCaching();
+ }
// convert the input stream to StreamCache if the stream cache is not disabled
- if (exchange.getProperty(Exchange.DISABLE_HTTP_STREAM_CACHE, Boolean.FALSE, Boolean.class)) {
+ if (exchange.getProperty(Exchange.DISABLE_HTTP_STREAM_CACHE, disableStreamCaching, Boolean.class)) {
return is;
} else {
CachedOutputStream cos = new CachedOutputStream(exchange);