You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/01/07 09:35:09 UTC

[GitHub] [rocketmq] zhangjidi2016 commented on a change in pull request #3723: [ISSUE #3709]Resolve export metadata errors while multiple brokers.

zhangjidi2016 commented on a change in pull request #3723:
URL: https://github.com/apache/rocketmq/pull/3723#discussion_r780133667



##########
File path: tools/src/main/java/org/apache/rocketmq/tools/command/export/ExportMetadataCommand.java
##########
@@ -126,18 +127,19 @@ public void execute(CommandLine commandLine, Options options, RPCHook rpcHook)
 
                     SubscriptionGroupWrapper subscriptionGroupWrapper = defaultMQAdminExt.getUserSubscriptionGroup(
                         addr, 10000);
+                    String brokerName = CommandUtil.fetchBrokerNameByAddr(defaultMQAdminExt, addr);
 
                     if (commandLine.hasOption('t')) {
-                        filePath = filePath + "/topic.json";
-                        MixAll.string2FileNotSafe(JSON.toJSONString(topicConfigSerializeWrapper, true), filePath);
-                        System.out.printf("export %s success", filePath);
-                        return;
-                    } else if (commandLine.hasOption('g')) {
-                        filePath = filePath + "/subscriptionGroup.json";
-                        MixAll.string2FileNotSafe(JSON.toJSONString(subscriptionGroupWrapper, true), filePath);
-                        System.out.printf("export %s success", filePath);
-                        return;
-                    } else {
+                        String exportFilePath = filePath + "/" + brokerName + "/topic.json";

Review comment:
       The issue is resolving by this pr(#3727),I will close it.




-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org