activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1463789 - in /activemq/trunk/activemq-pool/src: main/java/org/apache/activemq/pool/ test/java/org/apache/activemq/pool/
Date Tue, 02 Apr 2013 23:19:16 GMT
Author: gtully
Date: Tue Apr  2 23:19:16 2013
New Revision: 1463789

URL: http://svn.apache.org/r1463789
Log:
https://issues.apache.org/jira/browse/AMQ-4426 - queuesender and topicpublisher need to delegate
destination tracking, otherwise anonymous publishers return null destination

Modified:
    activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledQueueSender.java
    activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledSession.java
    activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledTopicPublisher.java
    activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/XAConnectionPoolTest.java

Modified: activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledQueueSender.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledQueueSender.java?rev=1463789&r1=1463788&r2=1463789&view=diff
==============================================================================
--- activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledQueueSender.java
(original)
+++ activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledQueueSender.java
Tue Apr  2 23:19:16 2013
@@ -45,7 +45,7 @@ public class PooledQueueSender extends P
 
     @Override
     public Queue getQueue() throws JMSException {
-        return getQueueSender().getQueue();
+        return (Queue) getDestination();
     }
 
     protected ActiveMQQueueSender getQueueSender() {

Modified: activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledSession.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledSession.java?rev=1463789&r1=1463788&r2=1463789&view=diff
==============================================================================
--- activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledSession.java
(original)
+++ activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledSession.java
Tue Apr  2 23:19:16 2013
@@ -149,7 +149,7 @@ public class PooledSession implements Se
                 try {
                     sessionPool.invalidateObject(key, this);
                 } catch (Exception e) {
-                    throw JMSExceptionSupport.create(e);
+                    LOG.trace("Ignoring exception on invalidateObject as discarding session:
" + e, e);
                 }
             } else {
                 try {

Modified: activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledTopicPublisher.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledTopicPublisher.java?rev=1463789&r1=1463788&r2=1463789&view=diff
==============================================================================
--- activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledTopicPublisher.java
(original)
+++ activemq/trunk/activemq-pool/src/main/java/org/apache/activemq/pool/PooledTopicPublisher.java
Tue Apr  2 23:19:16 2013
@@ -35,7 +35,7 @@ public class PooledTopicPublisher extend
 
     @Override
     public Topic getTopic() throws JMSException {
-        return getTopicPublisher().getTopic();
+        return (Topic) getDestination();
     }
 
     @Override

Modified: activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/XAConnectionPoolTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/XAConnectionPoolTest.java?rev=1463789&r1=1463788&r2=1463789&view=diff
==============================================================================
--- activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/XAConnectionPoolTest.java
(original)
+++ activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/XAConnectionPoolTest.java
Tue Apr  2 23:19:16 2013
@@ -18,7 +18,11 @@ package org.apache.activemq.pool;
 
 import java.util.Hashtable;
 import java.util.Vector;
+import javax.jms.BytesMessage;
+import javax.jms.QueueConnection;
 import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
 import javax.jms.Session;
 import javax.jms.TopicConnection;
 import javax.jms.TopicConnectionFactory;
@@ -167,4 +171,23 @@ public class XAConnectionPoolTest extend
         assertFalse(pcf.isTmFromJndi());
     }
 
+    public void testSenderAndPublisherDest() throws Exception {
+        XaPooledConnectionFactory pcf = new XaPooledConnectionFactory();
+        pcf.setConnectionFactory(new ActiveMQXAConnectionFactory("vm://test?broker.persistent=false"));
+
+        QueueConnection connection = pcf.createQueueConnection();
+        QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+        QueueSender sender = session.createSender(session.createQueue("AA"));
+        assertNotNull(sender.getQueue().getQueueName());
+
+        connection.close();
+
+        TopicConnection topicConnection = pcf.createTopicConnection();
+        TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+        TopicPublisher topicPublisher = topicSession.createPublisher(topicSession.createTopic("AA"));
+        assertNotNull(topicPublisher.getTopic().getTopicName());
+
+        topicConnection.close();
+    }
+
 }



Mime
View raw message