From 94c86257388f64937c823b88c869aa181976d049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=97=AD?= Date: Wed, 10 Feb 2021 09:39:31 +0800 Subject: [PATCH] Fix dashboard notification when set rocketmq.config.enableDashBoardCollect=false (#679) Co-authored-by: zhangxu16 --- .../console/service/impl/DashboardCollectServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/rocketmq/console/service/impl/DashboardCollectServiceImpl.java b/src/main/java/org/apache/rocketmq/console/service/impl/DashboardCollectServiceImpl.java index a3f7d73..2a895dd 100644 --- a/src/main/java/org/apache/rocketmq/console/service/impl/DashboardCollectServiceImpl.java +++ b/src/main/java/org/apache/rocketmq/console/service/impl/DashboardCollectServiceImpl.java @@ -36,7 +36,6 @@ import java.util.Map; import java.util.Set; import javax.annotation.Resource; import org.apache.rocketmq.console.config.RMQConfigure; -import org.apache.rocketmq.console.exception.ServiceException; import org.apache.rocketmq.console.service.DashboardCollectService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -137,7 +136,8 @@ public class DashboardCollectServiceImpl implements DashboardCollectService { String dataLocationPath = rmqConfigure.getConsoleCollectData(); File file = new File(dataLocationPath + date + ".json"); if (!file.exists()) { - throw Throwables.propagate(new ServiceException(1, "This date have't data!")); + log.info(String.format("No dashboard data for broker cache data: %s", date)); + return Maps.newHashMap(); } return jsonDataFile2map(file); }