This is an automated email from the ASF dual-hosted git repository.
jinrongtong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git
The following commit(s) were added to refs/heads/master by this push:
new c85aa2e fix: Solve the null pointer after a single refresh of the
consumer #295 (#296)
c85aa2e is described below
commit c85aa2e2a91285555907170a711bfbce38697822
Author: Crazylychee <[email protected]>
AuthorDate: Thu Jun 12 10:45:38 2025 +0800
fix: Solve the null pointer after a single refresh of the consumer #295
(#296)
---
.../apache/rocketmq/dashboard/service/impl/ConsumerServiceImpl.java | 5 ++++-
.../org/apache/rocketmq/dashboard/service/impl/TopicServiceImpl.java | 2 --
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git
a/src/main/java/org/apache/rocketmq/dashboard/service/impl/ConsumerServiceImpl.java
b/src/main/java/org/apache/rocketmq/dashboard/service/impl/ConsumerServiceImpl.java
index 2219782..a91cbeb 100644
---
a/src/main/java/org/apache/rocketmq/dashboard/service/impl/ConsumerServiceImpl.java
+++
b/src/main/java/org/apache/rocketmq/dashboard/service/impl/ConsumerServiceImpl.java
@@ -103,6 +103,8 @@ public class ConsumerServiceImpl extends
AbstractCommonService implements Consum
private final List<GroupConsumeInfo> cacheConsumeInfoList =
Collections.synchronizedList(new ArrayList<>());
+ private final HashMap<String, List<String>> consumerGroupMap =
Maps.newHashMap();
+
@Override
public void afterPropertiesSet() {
Runtime runtime = Runtime.getRuntime();
@@ -174,7 +176,6 @@ public class ConsumerServiceImpl extends
AbstractCommonService implements Consum
public void makeGroupListCache() {
- HashMap<String, List<String>> consumerGroupMap = Maps.newHashMap();
SubscriptionGroupWrapper subscriptionGroupWrapper = null;
try {
ClusterInfo clusterInfo = clusterInfoService.get();
@@ -530,6 +531,7 @@ public class ConsumerServiceImpl extends
AbstractCommonService implements Consum
GroupConsumeInfo updatedInfo = queryGroup(consumerGroup,
"");
updatedInfo.setUpdateTime(new Date());
updatedInfo.setGroup(consumerGroup);
+
updatedInfo.setAddress(consumerGroupMap.get(consumerGroup));
cacheConsumeInfoList.set(i, updatedInfo);
return updatedInfo;
}
@@ -541,6 +543,7 @@ public class ConsumerServiceImpl extends
AbstractCommonService implements Consum
@Override
public List<GroupConsumeInfo> refreshAllGroup(String address) {
cacheConsumeInfoList.clear();
+ consumerGroupMap.clear();
return queryGroupList(false, address);
}
}
diff --git
a/src/main/java/org/apache/rocketmq/dashboard/service/impl/TopicServiceImpl.java
b/src/main/java/org/apache/rocketmq/dashboard/service/impl/TopicServiceImpl.java
index 14c00a2..b017683 100644
---
a/src/main/java/org/apache/rocketmq/dashboard/service/impl/TopicServiceImpl.java
+++
b/src/main/java/org/apache/rocketmq/dashboard/service/impl/TopicServiceImpl.java
@@ -91,8 +91,6 @@ public class TopicServiceImpl extends AbstractCommonService
implements TopicServ
@Autowired
private RMQConfigure configure;
- private final ConcurrentMap<String, TopicConfig> topicConfigCache = new
ConcurrentHashMap<>();
-
@Override
public TopicList fetchAllTopicList(boolean skipSysProcess, boolean
skipRetryAndDlq) {
try {