You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2017/09/13 22:21:24 UTC

[1/2] activemq-artemis git commit: This closes #1527

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 8156879cf -> 17083d69e


This closes #1527


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

Branch: refs/heads/master
Commit: 17083d69e03bad42f1a156064860ac5928258148
Parents: 8156879 7d943cc
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Sep 13 18:21:13 2017 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Sep 13 18:21:13 2017 -0400

----------------------------------------------------------------------
 .../codec/PersistentQueueBindingEncoding.java   |  2 +-
 .../core/server/impl/ActiveMQServerImpl.java    |  4 +-
 .../persistence/QueueConfigRestartTest.java     | 71 ++++++++++++++++++++
 3 files changed, 74 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[2/2] activemq-artemis git commit: ARTEMIS-1405: Fix PurgeOnNoConsumer queue config is not persisted on restart

Posted by cl...@apache.org.
ARTEMIS-1405: Fix PurgeOnNoConsumer queue config is not persisted on restart

Added integration test, to prove issue, and assert fix.
Fix PersistentQueueBindingEncoding to return value, not false.
Fix some method arg name to align with class interface arg name

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

Branch: refs/heads/master
Commit: 7d943cc6f7a8fd736668bafb51c19f6eb3f54dee
Parents: 8156879
Author: Michael Andre Pearce <Mi...@me.com>
Authored: Mon Sep 11 17:19:30 2017 +0100
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Sep 13 18:21:13 2017 -0400

----------------------------------------------------------------------
 .../codec/PersistentQueueBindingEncoding.java   |  2 +-
 .../core/server/impl/ActiveMQServerImpl.java    |  4 +-
 .../persistence/QueueConfigRestartTest.java     | 71 ++++++++++++++++++++
 3 files changed, 74 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7d943cc6/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentQueueBindingEncoding.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentQueueBindingEncoding.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentQueueBindingEncoding.java
index 6cac641..af2c675 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentQueueBindingEncoding.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentQueueBindingEncoding.java
@@ -155,7 +155,7 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin
 
    @Override
    public boolean isPurgeOnNoConsumers() {
-      return false;
+      return purgeOnNoConsumers;
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7d943cc6/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 772e195..d58799e 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -1699,9 +1699,9 @@ public class ActiveMQServerImpl implements ActiveMQServer {
                             boolean temporary,
                             boolean autoCreated,
                             Integer maxConsumers,
-                            Boolean deleteOnNoConsumers,
+                            Boolean purgeOnNoConsumers,
                             boolean autoCreateAddress) throws Exception {
-      return createQueue(address, routingType, queueName, filter, user, durable, temporary, false, false, autoCreated, maxConsumers, deleteOnNoConsumers, autoCreateAddress);
+      return createQueue(address, routingType, queueName, filter, user, durable, temporary, false, false, autoCreated, maxConsumers, purgeOnNoConsumers, autoCreateAddress);
    }
 
    @Deprecated

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7d943cc6/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/QueueConfigRestartTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/QueueConfigRestartTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/QueueConfigRestartTest.java
new file mode 100644
index 0000000..0ebb30f
--- /dev/null
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/QueueConfigRestartTest.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.tests.integration.persistence;
+
+import org.apache.activemq.artemis.api.core.RoutingType;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.postoffice.QueueBinding;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class QueueConfigRestartTest extends ActiveMQTestBase {
+
+   // Constants -----------------------------------------------------
+
+   private static final String ADDRESS = "ADDRESS";
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+
+
+   @Test
+   public void testQueueConfigPurgeOnNoConsumerAndRestart() throws Exception {
+      ActiveMQServer server = createServer(true);
+
+      server.start();
+
+      SimpleString address = new SimpleString("test.address");
+      SimpleString queue = new SimpleString("test.queue");
+
+      server.createQueue(address, RoutingType.MULTICAST, queue, null, null, true, false, false, 10, true, true);
+
+      QueueBinding queueBinding1 = (QueueBinding)server.getPostOffice().getBinding(queue);
+      Assert.assertTrue(queueBinding1.getQueue().isPurgeOnNoConsumers());
+
+      server.stop();
+
+      server.start();
+
+      QueueBinding queueBinding2 = (QueueBinding)server.getPostOffice().getBinding(queue);
+      Assert.assertTrue(queueBinding2.getQueue().isPurgeOnNoConsumers());
+   }
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+
+}