@Test public void testReportConsumerRunningInfo() { TreeMap<String, ConsumerRunningInfo> criTable = new TreeMap<>(); ConsumerRunningInfo consumerRunningInfo = new ConsumerRunningInfo(); consumerRunningInfo.setSubscriptionSet(new TreeSet<SubscriptionData>()); consumerRunningInfo.setStatusTable(new TreeMap<String, ConsumeStatus>()); consumerRunningInfo.setSubscriptionSet(new TreeSet<SubscriptionData>()); consumerRunningInfo.setMqTable(new TreeMap<MessageQueue, ProcessQueueInfo>()); consumerRunningInfo.setProperties(new Properties()); criTable.put("test", consumerRunningInfo); defaultMonitorListener.reportConsumerRunningInfo(criTable); }
@Override public void reportConsumerRunningInfo(TreeMap<String, ConsumerRunningInfo> criTable) { { boolean result = ConsumerRunningInfo.analyzeSubscription(criTable); if (!result) { log.info(String.format(LOG_NOTIFY + "reportConsumerRunningInfo: ConsumerGroup: %s, Subscription different", criTable .firstEntry().getValue().getProperties().getProperty("consumerGroup"))); } } { Iterator<Entry<String, ConsumerRunningInfo>> it = criTable.entrySet().iterator(); while (it.hasNext()) { Entry<String, ConsumerRunningInfo> next = it.next(); String result = ConsumerRunningInfo.analyzeProcessQueue(next.getKey(), next.getValue()); if (!result.isEmpty()) { log.info(String.format(LOG_NOTIFY + "reportConsumerRunningInfo: ConsumerGroup: %s, ClientId: %s, %s", criTable.firstEntry().getValue().getProperties().getProperty("consumerGroup"), next.getKey(), result)); } } } }
DefaultMonitorListener implements MonitorListener { @Override public void reportConsumerRunningInfo(TreeMap<String, ConsumerRunningInfo> criTable) { { boolean result = ConsumerRunningInfo.analyzeSubscription(criTable); if (!result) { log.info(String.format(LOG_NOTIFY + "reportConsumerRunningInfo: ConsumerGroup: %s, Subscription different", criTable .firstEntry().getValue().getProperties().getProperty("consumerGroup"))); } } { Iterator<Entry<String, ConsumerRunningInfo>> it = criTable.entrySet().iterator(); while (it.hasNext()) { Entry<String, ConsumerRunningInfo> next = it.next(); String result = ConsumerRunningInfo.analyzeProcessQueue(next.getKey(), next.getValue()); if (!result.isEmpty()) { log.info(String.format(LOG_NOTIFY + "reportConsumerRunningInfo: ConsumerGroup: %s, ClientId: %s, %s", criTable.firstEntry().getValue().getProperties().getProperty("consumerGroup"), next.getKey(), result)); } } } } }
DefaultMonitorListener implements MonitorListener { @Override public void reportConsumerRunningInfo(TreeMap<String, ConsumerRunningInfo> criTable) { { boolean result = ConsumerRunningInfo.analyzeSubscription(criTable); if (!result) { log.info(String.format(LOG_NOTIFY + "reportConsumerRunningInfo: ConsumerGroup: %s, Subscription different", criTable .firstEntry().getValue().getProperties().getProperty("consumerGroup"))); } } { Iterator<Entry<String, ConsumerRunningInfo>> it = criTable.entrySet().iterator(); while (it.hasNext()) { Entry<String, ConsumerRunningInfo> next = it.next(); String result = ConsumerRunningInfo.analyzeProcessQueue(next.getKey(), next.getValue()); if (!result.isEmpty()) { log.info(String.format(LOG_NOTIFY + "reportConsumerRunningInfo: ConsumerGroup: %s, ClientId: %s, %s", criTable.firstEntry().getValue().getProperties().getProperty("consumerGroup"), next.getKey(), result)); } } } } DefaultMonitorListener(); }
DefaultMonitorListener implements MonitorListener { @Override public void reportConsumerRunningInfo(TreeMap<String, ConsumerRunningInfo> criTable) { { boolean result = ConsumerRunningInfo.analyzeSubscription(criTable); if (!result) { log.info(String.format(LOG_NOTIFY + "reportConsumerRunningInfo: ConsumerGroup: %s, Subscription different", criTable .firstEntry().getValue().getProperties().getProperty("consumerGroup"))); } } { Iterator<Entry<String, ConsumerRunningInfo>> it = criTable.entrySet().iterator(); while (it.hasNext()) { Entry<String, ConsumerRunningInfo> next = it.next(); String result = ConsumerRunningInfo.analyzeProcessQueue(next.getKey(), next.getValue()); if (!result.isEmpty()) { log.info(String.format(LOG_NOTIFY + "reportConsumerRunningInfo: ConsumerGroup: %s, ClientId: %s, %s", criTable.firstEntry().getValue().getProperties().getProperty("consumerGroup"), next.getKey(), result)); } } } } DefaultMonitorListener(); @Override void beginRound(); @Override void reportUndoneMsgs(UndoneMsgs undoneMsgs); @Override void reportFailedMsgs(FailedMsgs failedMsgs); @Override void reportDeleteMsgsEvent(DeleteMsgsEvent deleteMsgsEvent); @Override void reportConsumerRunningInfo(TreeMap<String, ConsumerRunningInfo> criTable); @Override void endRound(); }
DefaultMonitorListener implements MonitorListener { @Override public void reportConsumerRunningInfo(TreeMap<String, ConsumerRunningInfo> criTable) { { boolean result = ConsumerRunningInfo.analyzeSubscription(criTable); if (!result) { log.info(String.format(LOG_NOTIFY + "reportConsumerRunningInfo: ConsumerGroup: %s, Subscription different", criTable .firstEntry().getValue().getProperties().getProperty("consumerGroup"))); } } { Iterator<Entry<String, ConsumerRunningInfo>> it = criTable.entrySet().iterator(); while (it.hasNext()) { Entry<String, ConsumerRunningInfo> next = it.next(); String result = ConsumerRunningInfo.analyzeProcessQueue(next.getKey(), next.getValue()); if (!result.isEmpty()) { log.info(String.format(LOG_NOTIFY + "reportConsumerRunningInfo: ConsumerGroup: %s, ClientId: %s, %s", criTable.firstEntry().getValue().getProperties().getProperty("consumerGroup"), next.getKey(), result)); } } } } DefaultMonitorListener(); @Override void beginRound(); @Override void reportUndoneMsgs(UndoneMsgs undoneMsgs); @Override void reportFailedMsgs(FailedMsgs failedMsgs); @Override void reportDeleteMsgsEvent(DeleteMsgsEvent deleteMsgsEvent); @Override void reportConsumerRunningInfo(TreeMap<String, ConsumerRunningInfo> criTable); @Override void endRound();  }