Check to see if disableStreamCache is enabled before consuming the httpResponse entity
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fbf5bcf8 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fbf5bcf8 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fbf5bcf8 Branch: refs/heads/camel-2.17.x Commit: fbf5bcf8df972ea531fd1e469acd08a77f5f736e Parents: 6efd046 Author: Edward Welch <e...@edjusted.com> Authored: Wed Apr 6 07:35:10 2016 -0400 Committer: Claus Ibsen <davscl...@apache.org> Committed: Thu Apr 7 10:42:35 2016 +0200 ---------------------------------------------------------------------- .../main/java/org/apache/camel/component/http4/HttpProducer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/fbf5bcf8/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java index 7622d02..4edc6c5 100644 --- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java +++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java @@ -179,7 +179,7 @@ public class HttpProducer extends DefaultProducer { } } } finally { - if (httpResponse != null) { + if (httpResponse != null && !getEndpoint().isDisableStreamCache()) { try { EntityUtils.consume(httpResponse.getEntity()); } catch (IOException e) {