You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2021/09/13 14:11:55 UTC

[GitHub] [activemq-artemis] gtully commented on a change in pull request #3742: ARTEMIS-2007 - refactor to make use of existing refCountForConsumers …

gtully commented on a change in pull request #3742:
URL: https://github.com/apache/activemq-artemis/pull/3742#discussion_r707374180



##########
File path: artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
##########
@@ -1572,18 +1556,7 @@ public synchronized void cancelRedistributor() {
 
    @Override
    public int getConsumerCount() {
-      // we don't want to count the redistributor, it is an internal transient entry in the consumer list
-      if (redistributor != null) {
-         synchronized (this) {
-            final int size = consumers.size();
-            if (size > 0 && redistributor != null) {
-               return size - 1;
-            } else {
-               return size;
-            }
-         }
-      }
-      return consumers.size();
+      return refCountForConsumers.getCount();

Review comment:
       the point is there are two different counts, now that consumers has a redistributor that is internal. The need to keep then in sync is not new and it is confined to add/remove consumers




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org