From e6befbc8750127d3f1a0a36eec91507b57aef2ab Mon Sep 17 00:00:00 2001 From: Jonathan Gallimore Date: Wed, 12 Feb 2020 11:15:59 +0000 Subject: [PATCH] AMQ-7404 add debug logging for selectors loaded from the cache file --- .../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 bc55eac4cb..ecea02fb62 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>) 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 {