activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [45/55] [abbrv] activemq-artemis git commit: Fix REST Module QueueServiceManager
Date Wed, 07 Dec 2016 18:18:48 GMT
Fix REST Module QueueServiceManager

Fix TopicServiceManager

Fix SelectorTest Topic prefix

fix checkstyle


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

Branch: refs/heads/ARTEMIS-780
Commit: e3e95476d90dc5b0c63ca1f564e82d410b545450
Parents: 0a38e78
Author: Martyn Taylor <mtaylor@redhat.com>
Authored: Wed Nov 30 12:49:38 2016 +0000
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Dec 7 13:16:35 2016 -0500

----------------------------------------------------------------------
 .../activemq/artemis/rest/queue/QueueServiceManager.java | 11 +++++++++--
 .../activemq/artemis/rest/topic/TopicServiceManager.java | 11 +++++------
 .../apache/activemq/artemis/rest/test/SelectorTest.java  |  2 +-
 3 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e3e95476/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..170285a 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,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.push.FilePushStore;
 import org.apache.activemq.artemis.rest.queue.push.PushStore;
@@ -82,9 +83,15 @@ 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());
+            }
          }
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e3e95476/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());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e3e95476/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SelectorTest.java
----------------------------------------------------------------------
diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SelectorTest.java
b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SelectorTest.java
index 1491f51..245d25c 100644
--- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SelectorTest.java
+++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SelectorTest.java
@@ -46,7 +46,7 @@ public class SelectorTest extends MessageTestBase {
 
    public static ConnectionFactory connectionFactory;
    public static String topicName = "testTopic";
-   public static String prefixedTopicName = ActiveMQDestination.createQueueAddressFromName(topicName).toString();
+   public static String prefixedTopicName = ActiveMQDestination.createTopicAddressFromName(topicName).toString();
 
    @BeforeClass
    public static void setup() throws Exception {


Mime
View raw message