camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [1/2] camel git commit: Only pass through headers if there is a result set
Date Thu, 21 Jul 2016 12:07:06 GMT
Repository: camel
Updated Branches:
  refs/heads/master 857311be5 -> db0682f1e


Only pass through headers if there is a result set


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

Branch: refs/heads/master
Commit: db0682f1e4384e8025557358f5f193ae706ddbde
Parents: 35581bd
Author: Doug Tung <dwtung@isg.la>
Authored: Wed Jul 20 09:12:09 2016 -0700
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Thu Jul 21 14:02:59 2016 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/camel/component/sql/SqlProducer.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/db0682f1/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java
b/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java
index da6a9cf..f369234 100644
--- a/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java
+++ b/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java
@@ -277,11 +277,11 @@ public class SqlProducer extends DefaultProducer {
             }
 
             boolean isResultSet = ps.execute();
-            //pass through all headers
-            exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders());
             if (isResultSet) {
                 rs = ps.getResultSet();
                 ResultSetIterator iterator = getEndpoint().queryForStreamList(con, ps, rs);
+                //pass through all headers
+                exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders());
                 if (getEndpoint().isNoop()) {
                     exchange.getOut().setBody(exchange.getIn().getBody());
                 } else if (getEndpoint().getOutputHeader() != null) {


Mime
View raw message