camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] camel git commit: CAMEL-8489: camel-sjms - allow null body option.
Date Sun, 15 Mar 2015 11:40:06 GMT
CAMEL-8489: camel-sjms - allow null body option.


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

Branch: refs/heads/camel-2.15.x
Commit: 275d2e70ed83875b89439d7b420526afef15ea6f
Parents: 52dfc90
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sun Mar 15 12:38:31 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun Mar 15 12:41:44 2015 +0100

----------------------------------------------------------------------
 .../org/apache/camel/component/sjms/jms/JmsMessageHelper.java     | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/275d2e70/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsMessageHelper.java
----------------------------------------------------------------------
diff --git a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsMessageHelper.java
b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsMessageHelper.java
index 81091d6..f065bbe 100644
--- a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsMessageHelper.java
+++ b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsMessageHelper.java
@@ -47,6 +47,7 @@ import org.apache.camel.TypeConverter;
 import org.apache.camel.component.sjms.SjmsConstants;
 import org.apache.camel.component.sjms.SjmsEndpoint;
 import org.apache.camel.impl.DefaultMessage;
+import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -198,6 +199,8 @@ public final class JmsMessageHelper implements JmsConstants {
         case Message:
             if (allowNullBody && payload == null) {
                 answer = session.createMessage();
+            } else if (payload != null) {
+                throw new JMSException("Unsupported message body type " + ObjectHelper.classCanonicalName(payload));
             } else {
                 throw new JMSException("Null body is not allowed");
             }


Mime
View raw message