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:57 UTC
[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
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);