Updated Branches:
  refs/heads/camel-2.11.x 305788419 -> 5b599a2cf

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/5b599a2c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5b599a2c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5b599a2c

Branch: refs/heads/camel-2.11.x
Commit: 5b599a2cf6247eee039f47aaba3b4ef0df8f1094
Parents: 3057884
Author: cmueller <cmuel...@apache.org>
Authored: Thu Aug 15 23:46:46 2013 +0200
Committer: cmueller <cmuel...@apache.org>
Committed: Thu Aug 15 23:50:06 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/5b599a2c/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 {

Reply via email to