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

clebertsuconic 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 28513e048f ARTEMIS-3753 Small Improvement on 
RouterContext.internalOnly calculation
28513e048f is described below

commit 28513e048f7e3e8a5795253ec18364da304b33de
Author: Clebert Suconic <[email protected]>
AuthorDate: Sat Apr 23 11:17:24 2022 -0400

    ARTEMIS-3753 Small Improvement on RouterContext.internalOnly calculation
---
 .../activemq/artemis/core/server/impl/RoutingContextImpl.java     | 8 ++++----
 .../tests/integration/amqp/connect/AMQPClusterReplicaTest.java    | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RoutingContextImpl.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RoutingContextImpl.java
index 033c3a719c..6b9d8e2afe 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RoutingContextImpl.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RoutingContextImpl.java
@@ -177,12 +177,12 @@ public class RoutingContextImpl implements RoutingContext 
{
       }
 
       if (internalOnly == null) {
-         internalOnly = true;
+         internalOnly = queue.isInternalQueue();
+      } else {
+         // every queue added has to be internal only
+         internalOnly = internalOnly && queue.isInternalQueue();
       }
 
-      // every queue added has to be internal only
-      internalOnly = internalOnly && queue.isInternalQueue();
-
       queueCount++;
    }
 
diff --git 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPClusterReplicaTest.java
 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPClusterReplicaTest.java
index 69e026f1cd..e5156591ce 100644
--- 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPClusterReplicaTest.java
+++ 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPClusterReplicaTest.java
@@ -121,11 +121,11 @@ public class AMQPClusterReplicaTest extends 
AmqpClientTestSupport {
             producer.send(session.createTextMessage("hello"));
          }
 
-         org.apache.activemq.artemis.core.server.Queue mainServerQueue = 
server.locateQueue("test");
          org.apache.activemq.artemis.core.server.Queue node1Queue = 
node_1.locateQueue("test");
-         org.apache.activemq.artemis.core.server.Queue node2Queue = 
node_2.locateQueue("test");
 
          Wait.assertEquals(10L, node1Queue::getMessageCount, 5000, 10);
+
+         connection.close();
       }
    }
 

Reply via email to