You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/04/30 10:53:56 UTC

[1/3] camel git commit: CAMEL-9805: camel-sql - body not copied from in to out when useing outputHeader and outputType=SelectOne when sql doesn't return a result. Same fix for camel-elsql

Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x 09f47bc0c -> 3971a368b
  refs/heads/camel-2.17.x 77428ae1c -> fc0812153
  refs/heads/master dda7ca31d -> 893d25645


CAMEL-9805: camel-sql - body not copied from in to out when useing outputHeader and outputType=SelectOne when sql doesn't return a result. Same fix for camel-elsql


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

Branch: refs/heads/master
Commit: 893d256453d22bd60b2b0b5220608831d965d1c3
Parents: dda7ca3
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Apr 30 10:52:31 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Apr 30 10:52:31 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/component/elsql/ElsqlProducer.java  | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/893d2564/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java b/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java
index 78d0d2e..6cd236b 100644
--- a/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java
+++ b/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java
@@ -102,6 +102,13 @@ public class ElsqlProducer extends DefaultProducer {
                                     exchange.getOut().setBody(data);
                                 }
                                 exchange.getOut().setHeader(SqlConstants.SQL_ROW_COUNT, 1);
+                            } else {
+                                if (getEndpoint().isNoop()) {
+                                    exchange.getOut().setBody(exchange.getIn().getBody());
+                                } else if (getEndpoint().getOutputHeader() != null) {
+                                    exchange.getOut().setBody(exchange.getIn().getBody());
+                                }
+                                exchange.getOut().setHeader(SqlConstants.SQL_ROW_COUNT, 0);
                             }
                         } else {
                             throw new IllegalArgumentException("Invalid outputType=" + outputType);


[2/3] camel git commit: CAMEL-9805: camel-sql - body not copied from in to out when useing outputHeader and outputType=SelectOne when sql doesn't return a result. Same fix for camel-elsql

Posted by da...@apache.org.
CAMEL-9805: camel-sql - body not copied from in to out when useing outputHeader and outputType=SelectOne when sql doesn't return a result. Same fix for camel-elsql


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

Branch: refs/heads/camel-2.17.x
Commit: fc0812153fd143ede1095a7902c064a4401e188e
Parents: 77428ae
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Apr 30 10:52:31 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Apr 30 10:53:33 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/component/elsql/ElsqlProducer.java  | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/fc081215/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java b/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java
index 78d0d2e..6cd236b 100644
--- a/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java
+++ b/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java
@@ -102,6 +102,13 @@ public class ElsqlProducer extends DefaultProducer {
                                     exchange.getOut().setBody(data);
                                 }
                                 exchange.getOut().setHeader(SqlConstants.SQL_ROW_COUNT, 1);
+                            } else {
+                                if (getEndpoint().isNoop()) {
+                                    exchange.getOut().setBody(exchange.getIn().getBody());
+                                } else if (getEndpoint().getOutputHeader() != null) {
+                                    exchange.getOut().setBody(exchange.getIn().getBody());
+                                }
+                                exchange.getOut().setHeader(SqlConstants.SQL_ROW_COUNT, 0);
                             }
                         } else {
                             throw new IllegalArgumentException("Invalid outputType=" + outputType);


[3/3] camel git commit: CAMEL-9805: camel-sql - body not copied from in to out when useing outputHeader and outputType=SelectOne when sql doesn't return a result. Same fix for camel-elsql

Posted by da...@apache.org.
CAMEL-9805: camel-sql - body not copied from in to out when useing outputHeader and outputType=SelectOne when sql doesn't return a result. Same fix for camel-elsql


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

Branch: refs/heads/camel-2.16.x
Commit: 3971a368b64a3ed3c3295a9804f6dc1205c5562e
Parents: 09f47bc
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Apr 30 10:52:31 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Apr 30 10:53:47 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/component/elsql/ElsqlProducer.java  | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3971a368/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java b/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java
index 78d0d2e..6cd236b 100644
--- a/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java
+++ b/components/camel-elsql/src/main/java/org/apache/camel/component/elsql/ElsqlProducer.java
@@ -102,6 +102,13 @@ public class ElsqlProducer extends DefaultProducer {
                                     exchange.getOut().setBody(data);
                                 }
                                 exchange.getOut().setHeader(SqlConstants.SQL_ROW_COUNT, 1);
+                            } else {
+                                if (getEndpoint().isNoop()) {
+                                    exchange.getOut().setBody(exchange.getIn().getBody());
+                                } else if (getEndpoint().getOutputHeader() != null) {
+                                    exchange.getOut().setBody(exchange.getIn().getBody());
+                                }
+                                exchange.getOut().setHeader(SqlConstants.SQL_ROW_COUNT, 0);
                             }
                         } else {
                             throw new IllegalArgumentException("Invalid outputType=" + outputType);