StyleTang commented on a change in pull request #21:
URL: https://github.com/apache/rocketmq-dashboard/pull/21#discussion_r710923255
##########
File path: src/main/resources/static/src/messageTrace.js
##########
@@ -39,16 +43,25 @@ module.controller('messageTraceController', ['$scope',
'$routeParams', 'ngDialog
method: "GET",
url: "topic/list.query",
params: {
- skipSysProcess: "true"
+ skipSysProcess: true
}
}).success(function (resp) {
if (resp.status == 0) {
$scope.allTopicList = resp.data.topicList.sort();
- console.log($scope.allTopicList);
+ console.log($scope.allTopicList)
+ for (const topic of $scope.allTopicList) {
+ if (topic.startsWith(RETRY_GROUP_TOPIC_PREFIX)
+ || topic.startsWith(DLQ_GROUP_TOPIC_PREFIX)) {
Review comment:
👍
It’s great to delete useless system topics
##########
File path:
src/main/java/org/apache/rocketmq/dashboard/service/impl/TopicServiceImpl.java
##########
@@ -61,23 +63,23 @@
private RMQConfigure configure;
@Override
- public TopicList fetchAllTopicList(boolean skipSysProcess) {
+ public TopicList fetchAllTopicList(boolean skipSysProcess, boolean
skipRetryAndDlq) {
try {
TopicList allTopics = mqAdminExt.fetchAllTopicList();
- if (skipSysProcess) {
- return allTopics;
- }
-
TopicList sysTopics = getSystemTopicList();
- Set<String> topics = new HashSet<>();
-
- for (String topic : allTopics.getTopicList()) {
- if (sysTopics.getTopicList().contains(topic)) {
- topics.add(String.format("%s%s", "%SYS%", topic));
- } else {
- topics.add(topic);
- }
- }
+ Set<String> topics =
+ allTopics.getTopicList().stream().map(topic -> {
+ if (!skipSysProcess &&
sysTopics.getTopicList().contains(topic)) {
+ topic = String.format("%s%s", "%SYS%", topic);
+ }
+ return topic;
+ }).filter(topic -> {
+ if (skipRetryAndDlq) {
+ return
!(topic.startsWith(MixAll.RETRY_GROUP_TOPIC_PREFIX)
+ ||
topic.startsWith(MixAll.DLQ_GROUP_TOPIC_PREFIX));
+ }
+ return true;
+ }).collect(Collectors.toSet());
allTopics.getTopicList().clear();
allTopics.getTopicList().addAll(topics);
Review comment:
Trivial. (and it is not introduced by this PR, I'm OK to merge it)
can just use
```java
allTopics.setTopicList(topics);
```
--
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]