You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2023/08/31 16:35:16 UTC

[activemq-artemis] branch main updated: ARTEMIS-4396 fill in some gaps

This is an automated email from the ASF dual-hosted git repository.

jbertram pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new 60ac0f32a5 ARTEMIS-4396 fill in some gaps
60ac0f32a5 is described below

commit 60ac0f32a510b4e1cf79961ce10bc38f227bc55e
Author: Justin Bertram <jb...@apache.org>
AuthorDate: Thu Aug 31 11:35:00 2023 -0500

    ARTEMIS-4396 fill in some gaps
---
 .../core/server/impl/PostOfficeJournalLoader.java    |  3 ++-
 .../management/impl/ManagementServiceImpl.java       |  2 +-
 ...auseTest.java => QueueConfigPersistenceTest.java} | 20 ++++++++++++++++++--
 3 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java
index 3dbb426c7b..3dc127894a 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java
@@ -161,7 +161,8 @@ public class PostOfficeJournalLoader implements JournalLoader {
                                                              .setAutoDeleteMessageCount(queueBindingInfo.getAutoDeleteMessageCount())
                                                              .setRoutingType(RoutingType.getType(queueBindingInfo.getRoutingType()))
                                                              .setConfigurationManaged(queueBindingInfo.isConfigurationManaged())
-                                                             .setRingSize(queueBindingInfo.getRingSize()),
+                                                             .setRingSize(queueBindingInfo.getRingSize())
+                                                             .setInternal(queueBindingInfo.isInternal()),
                                                           pagingManager);
 
 
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
index d2f6dbee3a..92c523d1c5 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
@@ -288,7 +288,7 @@ public class ManagementServiceImpl implements ManagementService {
                                           final AddressInfo addressInfo,
                                           final StorageManager storageManager) throws Exception {
 
-      if (addressInfo.isInternal()) {
+      if (addressInfo.isInternal() || queue.isInternalQueue()) {
          logger.debug("won't register internal queue: {}", queue);
          return;
       }
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/QueuePeristPauseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/QueueConfigPersistenceTest.java
similarity index 74%
rename from tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/QueuePeristPauseTest.java
rename to tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/QueueConfigPersistenceTest.java
index 7613ad0c96..d4dc3ed99a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/QueuePeristPauseTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/QueueConfigPersistenceTest.java
@@ -18,6 +18,7 @@ package org.apache.activemq.artemis.tests.integration.server;
 
 import org.apache.activemq.artemis.api.core.QueueConfiguration;
 import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.management.ResourceNames;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.api.core.RoutingType;
@@ -25,10 +26,10 @@ import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class QueuePeristPauseTest extends ActiveMQTestBase {
+public class QueueConfigPersistenceTest extends ActiveMQTestBase {
 
    @Test
-      public void testPauseQueue() throws Exception {
+   public void testPauseQueue() throws Exception {
       ActiveMQServer server = createServer(true, false);
       server.start();
 
@@ -57,4 +58,19 @@ public class QueuePeristPauseTest extends ActiveMQTestBase {
 
       server.stop();
    }
+
+   @Test
+   public void testInternalQueue() throws Exception {
+      ActiveMQServer server = createServer(true, false);
+      server.start();
+
+      server.createQueue(new QueueConfiguration(getName()).setInternal(true));
+      server.stop();
+      server.start();
+      Queue queue = server.locateQueue(getName());
+      Assert.assertTrue(queue.isInternalQueue());
+      Assert.assertNull(server.getManagementService().getResource(ResourceNames.QUEUE + getName()));
+
+      server.stop();
+   }
 }