You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cs...@apache.org on 2020/07/24 18:18:19 UTC

[activemq] 01/02: [AMQ-8012] Fix for ConcurrentModificationException in SubQueueSelectorCacheBroker

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

cshannon pushed a commit to branch activemq-5.16.x
in repository https://gitbox.apache.org/repos/asf/activemq.git

commit dbf6e36e2c5400d920355ed362c231995b1efe61
Author: Matt Pavlovich <ma...@hyte.io>
AuthorDate: Fri Jul 24 12:22:12 2020 -0500

    [AMQ-8012] Fix for ConcurrentModificationException in SubQueueSelectorCacheBroker
    
     - Remove non-thread-safe method getSelectors()
     - Update all references to use the thread-safe getSelectorsForDestination() method
    
    (cherry picked from commit 083acb9691dba818aae3c0f72e7675c8a39d500a)
---
 .../region/virtual/SelectorAwareVirtualTopicInterceptor.java       | 2 +-
 .../org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java    | 7 -------
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.java
index d100c67..727f79d 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.java
@@ -77,7 +77,7 @@ public class SelectorAwareVirtualTopicInterceptor extends VirtualTopicIntercepto
         LOG.debug("No active consumer match found. Will try cache if configured...");
 
         if (selectorCachePlugin != null) {
-            final Set<String> selectors = selectorCachePlugin.getSelector(dest.getActiveMQDestination().getQualifiedName());
+            final Set<String> selectors = selectorCachePlugin.getSelectorsForDestination(dest.getActiveMQDestination().getQualifiedName());
             if (selectors != null) {
                 for (String selector : selectors) {
                     try {
diff --git a/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java b/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java
index 6147f4c..dbd9ad7 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java
@@ -249,13 +249,6 @@ public class SubQueueSelectorCacheBroker extends BrokerFilter implements Runnabl
     }
 
     /**
-     * @return The JMS selector for the specified {@code destination}
-     */
-    public Set<String> getSelector(final String destination) {
-        return subSelectorCache.get(destination);
-    }
-
-    /**
      * Persist the selector cache every {@code MAX_PERSIST_INTERVAL}ms.
      *
      * @see java.lang.Runnable#run()