jbonofre commented on a change in pull request #297:
URL: https://github.com/apache/activemq/pull/297#discussion_r598902108



##########
File path: 
activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java
##########
@@ -58,39 +49,27 @@
  * https://issues.apache.org/activemq/browse/AMQ-3004
  * 
http://mail-archives.apache.org/mod_mbox/activemq-users/201011.mbox/%[email protected]%3E
  */
-public class SubQueueSelectorCacheBroker extends BrokerFilter implements 
Runnable {
+public class SubQueueSelectorCacheBroker extends BrokerFilter {
     private static final Logger LOG = 
LoggerFactory.getLogger(SubQueueSelectorCacheBroker.class);
     public static final String MATCH_EVERYTHING = "TRUE";
 
     /**
      * The subscription's selector cache. We cache compiled expressions keyed
      * by the target destination.
      */
-    private ConcurrentMap<String, Set<String>> subSelectorCache = new 
ConcurrentHashMap<String, Set<String>>();
+    private final SubSelectorCache subSelectorCache;
 
-    private final File persistFile;
     private boolean singleSelectorPerDestination = false;
     private boolean ignoreWildcardSelectors = false;
     private ObjectName objectName;
 
-    private boolean running = true;
-    private final Thread persistThread;
-    private long persistInterval = MAX_PERSIST_INTERVAL;
-    public static final long MAX_PERSIST_INTERVAL = 600000;
-    private static final String SELECTOR_CACHE_PERSIST_THREAD_NAME = 
"SelectorCachePersistThread";
-
     /**
      * Constructor
      */
-    public SubQueueSelectorCacheBroker(Broker next, final File persistFile) {
+    public SubQueueSelectorCacheBroker(Broker next, final SubSelectorCache 
subSelectorCache) {

Review comment:
       Instead of changing the default behavior, I would rather create a 
totally new plugin, extending `SubQueueSelectorCacheBroker`. I think the 
configuration would be easier and less confusing for the users.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to