[AMQ-8012] Fix for ConcurrentModificationException in SubQueueSelectorCacheBroker

- Remove non-thread-safe method getSelectors()
 - Update all references to use the thread-safe getSelectorsForDestination() method
This commit is contained in:
Matt Pavlovich 2020-07-24 12:22:12 -05:00
parent 6c07033c58
commit 083acb9691
2 changed files with 1 additions and 8 deletions

View File

@ -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 {

View File

@ -248,13 +248,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.
*