activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From martyntay...@apache.org
Subject [26/27] activemq-artemis git commit: Fix TopicServiceManager
Date Wed, 30 Nov 2016 13:27:46 GMT
Fix TopicServiceManager


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/5547a6eb
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/5547a6eb
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/5547a6eb

Branch: refs/heads/ARTEMIS-780
Commit: 5547a6eb1a0ad15d0c61c2057b99e9629c1a9389
Parents: ea81ad1
Author: Martyn Taylor <mtaylor@redhat.com>
Authored: Wed Nov 30 12:55:56 2016 +0000
Committer: Martyn Taylor <mtaylor@redhat.com>
Committed: Wed Nov 30 12:55:56 2016 +0000

----------------------------------------------------------------------
 .../activemq/artemis/rest/topic/TopicServiceManager.java | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5547a6eb/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicServiceManager.java
----------------------------------------------------------------------
diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicServiceManager.java
b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicServiceManager.java
index 1b710ee..8944ecf 100644
--- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicServiceManager.java
+++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicServiceManager.java
@@ -21,6 +21,7 @@ import java.util.List;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
+import org.apache.activemq.artemis.core.server.RoutingType;
 import org.apache.activemq.artemis.jms.client.ConnectionFactoryOptions;
 import org.apache.activemq.artemis.rest.queue.DestinationServiceManager;
 
@@ -83,14 +84,12 @@ public class TopicServiceManager extends DestinationServiceManager {
       }
       String queueName = topicDeployment.getName();
       boolean defaultDurable;
+
       try (ClientSession session = sessionFactory.createSession(false, false, false)) {
-         ClientSession.QueueQuery query = session.queueQuery(new SimpleString(queueName));
          defaultDurable = topicDeployment.isDurableSend();
-         if (query.isExists()) {
-            defaultDurable = query.isDurable();
-         } else {
-            session.createQueue(queueName, queueName, topicDeployment.isDurableSend());
-         }
+         ClientSession.AddressQuery query = session.addressQuery(new SimpleString(queueName));
+         if (!query.isExists())
+            session.createAddress(SimpleString.toSimpleString(queueName), RoutingType.MULTICAST,
true);
       }
 
       destination.createTopicResource(queueName, defaultDurable, topicDeployment.getConsumerSessionTimeoutSeconds(),
topicDeployment.isDuplicatesAllowed());


Mime
View raw message