You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by cm...@apache.org on 2013/08/15 23:46:58 UTC

git commit: CAMEL-6641: SJMS component throws class cast error when used with IBM Webshpere MQ Thanks to Nigel Longton for the patch

Updated Branches:
  refs/heads/master d726000c3 -> 91622a51e


CAMEL-6641: SJMS component throws class cast error when used with IBM Webshpere MQ
Thanks to Nigel Longton for the patch


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

Branch: refs/heads/master
Commit: 91622a51e5a8f5118e2e17fcc8e1b8cede0d0165
Parents: d726000
Author: cmueller <cm...@apache.org>
Authored: Thu Aug 15 23:46:46 2013 +0200
Committer: cmueller <cm...@apache.org>
Committed: Thu Aug 15 23:46:46 2013 +0200

----------------------------------------------------------------------
 .../camel/component/sjms/jms/JmsObjectFactory.java       | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/91622a51/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsObjectFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsObjectFactory.java b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsObjectFactory.java
index 819546b..93040d5 100644
--- a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsObjectFactory.java
+++ b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsObjectFactory.java
@@ -22,7 +22,6 @@ import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.Topic;
-import javax.jms.TopicSession;
 
 import org.apache.camel.util.ObjectHelper;
 
@@ -119,20 +118,18 @@ public final class JmsObjectFactory {
         MessageConsumer messageConsumer = null;
         
         if (topic) {
-            TopicSession ts = (TopicSession)session;
             if (ObjectHelper.isNotEmpty(durableSubscriptionId)) {
                 if (ObjectHelper.isNotEmpty(messageSelector)) {
-                    messageConsumer = ts.createDurableSubscriber((Topic)destination, durableSubscriptionId,
+                    messageConsumer = session.createDurableSubscriber((Topic)destination, durableSubscriptionId,
                                                                  messageSelector, noLocal);
                 } else {
-                    messageConsumer = ts.createDurableSubscriber((Topic)destination, durableSubscriptionId);
+                    messageConsumer = session.createDurableSubscriber((Topic)destination, durableSubscriptionId);
                 }
-
             } else {
                 if (ObjectHelper.isNotEmpty(messageSelector)) {
-                    messageConsumer = ts.createSubscriber((Topic)destination, messageSelector, noLocal);
+                    messageConsumer = session.createConsumer((Topic)destination, messageSelector, noLocal);
                 } else {
-                    messageConsumer = ts.createSubscriber((Topic)destination);
+                    messageConsumer = session.createConsumer((Topic)destination);
                 }
             }
         } else {