activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-6210
Date Mon, 28 Mar 2016 18:40:08 GMT
Repository: activemq
Updated Branches:
  refs/heads/master f3ecc293f -> 48ba714b3


https://issues.apache.org/jira/browse/AMQ-6210

Clean up and apply filtering for temp destinations to removeConsumer as
well.  

This closes #175

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/48ba714b
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/48ba714b
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/48ba714b

Branch: refs/heads/master
Commit: 48ba714b3083b86a84ed3419df4fde21ec61e5d8
Parents: f3ecc29
Author: Timothy Bish <tabish121@gmail.com>
Authored: Mon Mar 28 14:40:00 2016 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Mon Mar 28 14:40:00 2016 -0400

----------------------------------------------------------------------
 .../activemq/plugin/SubQueueSelectorCacheBroker.java     | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/48ba714b/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java
----------------------------------------------------------------------
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 7b0e5ee..2d31b6e 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
@@ -171,8 +171,7 @@ public class SubQueueSelectorCacheBroker extends BrokerFilter implements
Runnabl
 
     @Override
     public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception
{
-        if (!AdvisorySupport.isAdvisoryTopic(info.getDestination())) {
-
+        if (!AdvisorySupport.isAdvisoryTopic(info.getDestination()) && !info.getDestination().isTemporary())
{
             if (singleSelectorPerDestination) {
                 String destinationName = info.getDestination().getQualifiedName();
                 Set<String> selectors = subSelectorCache.get(destinationName);
@@ -190,8 +189,7 @@ public class SubQueueSelectorCacheBroker extends BrokerFilter implements
Runnabl
     private void readCache() {
         if (persistFile != null && persistFile.exists()) {
             try {
-                FileInputStream fis = new FileInputStream(persistFile);
-                try {
+                try (FileInputStream fis = new FileInputStream(persistFile);) {
                     ObjectInputStream in = new ObjectInputStream(fis);
                     try {
                         subSelectorCache = (ConcurrentHashMap<String, Set<String>>)
in.readObject();
@@ -200,8 +198,6 @@ public class SubQueueSelectorCacheBroker extends BrokerFilter implements
Runnabl
                     } finally {
                         in.close();
                     }
-                } finally {
-                    fis.close();
                 }
             } catch (IOException ex) {
                 LOG.error("Unable to read persisted selector cache...it will be ignored!",
ex);
@@ -347,8 +343,9 @@ public class SubQueueSelectorCacheBroker extends BrokerFilter implements
Runnabl
             Matcher matcher = LIKE_PATTERN.matcher(selector);
 
             while(hasLikeOperator(matcher)) {
-                if (hasWildcardInCurrentMatch(matcher))
+                if (hasWildcardInCurrentMatch(matcher)) {
                     return true;
+                }
             }
             return false;
         }


Mime
View raw message