Repository: camel
Updated Branches:
refs/heads/camel-2.14.x 920429bd7 -> 2aecbaa2f
refs/heads/camel-2.15.x caa6db543 -> 7a5d8b986
CAMEL-8821 Support to disable the stream caching in camel-servlet from the
camel context
Conflicts:
components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpHelper.java
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5fd98e38
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5fd98e38
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5fd98e38
Branch: refs/heads/camel-2.15.x
Commit: 5fd98e38796657beecfc716669d043942bde18c9
Parents: caa6db5
Author: Willem Jiang <[email protected]>
Authored: Sun May 31 11:10:42 2015 +0800
Committer: Willem Jiang <[email protected]>
Committed: Sun May 31 12:30:02 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/5fd98e38/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 651c2ac..89a34c8 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
@@ -455,7 +455,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/5fd98e38/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 dade973..ecd66c7 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
@@ -40,6 +40,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.IOHelper;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.URISupport;
@@ -160,9 +161,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);