You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2020/02/14 07:21:51 UTC

[activemq] branch activemq-5.15.x updated: AMQ-7404 add debug logging for selectors loaded from the cache file

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

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


The following commit(s) were added to refs/heads/activemq-5.15.x by this push:
     new c78e9b1  AMQ-7404 add debug logging for selectors loaded from the cache file
c78e9b1 is described below

commit c78e9b11c4d2f4afbb8e621336666bae82dc7c20
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Wed Feb 12 11:15:59 2020 +0000

    AMQ-7404 add debug logging for selectors loaded from the cache file
    
    (cherry picked from commit e6befbc8750127d3f1a0a36eec91507b57aef2ab)
---
 .../apache/activemq/plugin/SubQueueSelectorCacheBroker.java | 13 +++++++++++++
 1 file changed, 13 insertions(+)

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 bc55eac..ecea02f 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
@@ -194,7 +194,20 @@ public class SubQueueSelectorCacheBroker extends BrokerFilter implements Runnabl
                 try (FileInputStream fis = new FileInputStream(persistFile);) {
                     ObjectInputStream in = new ObjectInputStream(fis);
                     try {
+                        LOG.debug("Reading selector cache....");
                         subSelectorCache = (ConcurrentHashMap<String, Set<String>>) in.readObject();
+
+                        if (LOG.isDebugEnabled()) {
+                            final StringBuilder sb = new StringBuilder();
+                            sb.append("Selector cache data loaded from: ").append(persistFile.getAbsolutePath()).append("\n");
+                            sb.append("The following entries were loaded from the cache file: \n");
+
+                            subSelectorCache.forEach((k,v) -> {
+                                sb.append("\t").append(k).append(": ").append(v).append("\n");
+                            });
+
+                            LOG.debug(sb.toString());
+                        }
                     } catch (ClassNotFoundException ex) {
                         LOG.error("Invalid selector cache data found. Please remove file.", ex);
                     } finally {