activemq-commits mailing list archives

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


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

Branch: refs/heads/ARTEMIS-780
Commit: ea81ad182d81e21f6eb3a94cb1911c32a36711a1
Parents: 6ae97b2
Author: Martyn Taylor <mtaylor@redhat.com>
Authored: Wed Nov 30 12:49:38 2016 +0000
Committer: Martyn Taylor <mtaylor@redhat.com>
Committed: Wed Nov 30 12:49:38 2016 +0000

----------------------------------------------------------------------
 .../artemis/rest/queue/QueueServiceManager.java        | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ea81ad18/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueServiceManager.java
----------------------------------------------------------------------
diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueServiceManager.java
b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueServiceManager.java
index a606044..f3efacb 100644
--- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueServiceManager.java
+++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueServiceManager.java
@@ -21,6 +21,8 @@ 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.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.jms.client.ConnectionFactoryOptions;
 import org.apache.activemq.artemis.rest.queue.push.FilePushStore;
 import org.apache.activemq.artemis.rest.queue.push.PushStore;
@@ -82,9 +84,16 @@ public class QueueServiceManager extends DestinationServiceManager {
       }
       String queueName = queueDeployment.getName();
       try (ClientSession session = sessionFactory.createSession(false, false, false)) {
-         ClientSession.QueueQuery query = session.queueQuery(new SimpleString(queueName));
+         ClientSession.AddressQuery query = session.addressQuery(SimpleString.toSimpleString(queueName));
          if (!query.isExists()) {
-            session.createQueue(queueName, queueName, queueDeployment.isDurableSend());
+            session.createAddress(SimpleString.toSimpleString(queueName), RoutingType.ANYCAST,
true);
+            session.createQueue(SimpleString.toSimpleString(queueName), RoutingType.ANYCAST,
SimpleString.toSimpleString(queueName), queueDeployment.isDurableSend());
+         }
+         else {
+            ClientSession.QueueQuery qquery = session.queueQuery(SimpleString.toSimpleString(queueName));
+            if (!qquery.isExists()) {
+               session.createQueue(SimpleString.toSimpleString(queueName), RoutingType.ANYCAST,
SimpleString.toSimpleString(queueName), queueDeployment.isDurableSend());
+            }
          }
       }
 


Mime
View raw message