tju-yxq opened a new pull request, #1400: URL: https://github.com/apache/rocketmq-dashboard/pull/1400
## What is the purpose of the change Fixes #1394 The dashboard's per-cluster overview cards were always showing `topics(0)` and `groups(0)` for every cluster, even though the global totals at the top of the dashboard were correct. This made it look like no cluster had any topics or groups. ## Brief changelog - **`RocketMQDashboardProvider.java`**: Added a `brokerAddrToCluster` map built from `ClusterInfo.clusterAddrTable` + `brokerAddrTable`. - **Topic counting**: For each non-system topic, look up its route data (`examineTopicRouteInfo`) to find which broker hosts it, then map that broker to its cluster. Accumulate per-cluster topic counts in `topicsByCluster`. - **Group counting**: When iterating brokers for subscription groups, associate each group with its broker's cluster. Accumulate per-cluster group counts in `groupsByCluster`. - **ClusterOverviewVO**: Changed from hardcoded `.topics(0).groups(0)` to `.topics(topicsByCluster.getOrDefault(clusterName, 0)).groups(groupsByCluster.getOrDefault(clusterName, 0))`. ## Verifying this change 1. Start a RocketMQ cluster with topics and consumer groups. 2. Open the dashboard. 3. Each cluster card should now show the actual topic and group counts instead of 0. - [x] Make sure there is a Github issue filed for the change. - [x] Format the pull request title like `[ISSUE #1394] ...`. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit-test to verify your logic correction. - [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. - [ ] If this contribution is large, please file an Apache Individual Contributor License Agreement. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
