camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [4/4] camel git commit: CAMEL-8082 CxfRs producer should close the connection if MEP is InOnly
Date Fri, 28 Nov 2014 10:49:54 GMT
CAMEL-8082 CxfRs producer should close the connection if MEP is InOnly


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3f1fdb64
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3f1fdb64
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3f1fdb64

Branch: refs/heads/camel-2.13.x
Commit: 3f1fdb64738f04ea50b9ad7302b22d77ea5c485d
Parents: 8af4742
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Thu Nov 27 15:15:16 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Fri Nov 28 18:49:26 2014 +0800

----------------------------------------------------------------------
 .../apache/camel/component/cxf/jaxrs/CxfRsProducer.java   | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3f1fdb64/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
index 7129829..32ed918 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
@@ -211,6 +211,11 @@ public class CxfRsProducer extends DefaultProducer {
             exchange.getOut().setBody(binding.bindResponseToCamelBody(response, exchange));
             exchange.getOut().getHeaders().putAll(binding.bindResponseHeadersToCamelHeaders(response,
exchange));
             exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, statesCode);
+        } else {
+            // just close the input stream of the response object
+            if (response instanceof Response) {
+                ((Response)response).close();
+            }
         }
     }
 
@@ -266,6 +271,11 @@ public class CxfRsProducer extends DefaultProducer {
             exchange.getOut().setBody(binding.bindResponseToCamelBody(response, exchange));
             exchange.getOut().getHeaders().putAll(binding.bindResponseHeadersToCamelHeaders(response,
exchange));
             exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, statesCode);
+        } else {
+            // just close the input stream of the response object
+            if (response instanceof Response) {
+                ((Response)response).close();
+            }
         }
     }
     


Mime
View raw message