From 552455048f71b00c905f70218186d627f0aff94f Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Wed, 4 Aug 2010 19:44:17 +0000 Subject: 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. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@982381 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/qpid/client/AMQTopic.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'qpid/java/client') diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java index 98509c1b99..eb432d3318 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java @@ -106,8 +106,20 @@ public class AMQTopic extends AMQDestination implements Topic 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 -- cgit v1.2.1