AMQ-7404 add debug logging for selectors loaded from the cache file

This commit is contained in:
Jonathan Gallimore 2020-02-12 11:15:59 +00:00
parent 098fd9c5a9
commit e6befbc875
1 changed files with 13 additions and 0 deletions

View File

@ -194,7 +194,20 @@ public class SubQueueSelectorCacheBroker extends BrokerFilter implements Runnabl
try (FileInputStream fis = new FileInputStream(persistFile);) { try (FileInputStream fis = new FileInputStream(persistFile);) {
ObjectInputStream in = new ObjectInputStream(fis); ObjectInputStream in = new ObjectInputStream(fis);
try { try {
LOG.debug("Reading selector cache....");
subSelectorCache = (ConcurrentHashMap<String, Set<String>>) in.readObject(); 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) { } catch (ClassNotFoundException ex) {
LOG.error("Invalid selector cache data found. Please remove file.", ex); LOG.error("Invalid selector cache data found. Please remove file.", ex);
} finally { } finally {