You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ra...@apache.org on 2010/08/04 21:44:17 UTC

svn commit: r982381 - /qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java

Author: rajith
Date: Wed Aug  4 19:44:17 2010
New Revision: 982381

URL: http://svn.apache.org/viewvc?rev=982381&view=rev
Log:
QPID-2786
This fix is only for creating a durable subscription without a selector.
When creating a durable subscription with a selector a different code path is used.
The patch in QPID-2418 attempts to fix the code duplication among other things.
Once that patch is applied I may have to readjust the code.
I will be adding a test case to DurableSubscriptionTest.java once the code is sorted out.

Modified:
    qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java

Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java?rev=982381&r1=982380&r2=982381&view=diff
==============================================================================
--- qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java (original)
+++ qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java Wed Aug  4 19:44:17 2010
@@ -106,8 +106,20 @@ public class AMQTopic extends AMQDestina
     public static AMQTopic createDurable010Topic(AMQTopic topic, String subscriptionName, AMQConnection connection)
             throws JMSException
     {
-        return new AMQTopic(topic.getExchangeName(), ExchangeDefaults.TOPIC_EXCHANGE_CLASS, topic.getRoutingKey(), true, false,
+        if (topic.getDestSyntax() == AMQDestination.DestSyntax.BURL)
+        {
+            return new AMQTopic(topic.getExchangeName(), ExchangeDefaults.TOPIC_EXCHANGE_CLASS, topic.getRoutingKey(), true, false,
               getDurableTopicQueueName(subscriptionName, connection), true);
+        }
+        else
+        {
+            return new AMQTopic(new AMQShortString(topic.getAddressName()), 
+                                ExchangeDefaults.TOPIC_EXCHANGE_CLASS, 
+                                new AMQShortString(topic.getSubject()), 
+                                true,
+                                false,
+                                getDurableTopicQueueName(subscriptionName, connection), true);
+        }
     }
 
     public static AMQShortString getDurableTopicQueueName(String subscriptionName, AMQConnection connection) throws JMSException



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org