Oliverwqcwrw commented on code in PR #4661:
URL: https://github.com/apache/rocketmq/pull/4661#discussion_r966489737


##########
common/src/main/java/org/apache/rocketmq/common/Configuration.java:
##########
@@ -219,6 +224,35 @@ public void persist() {
         }
     }
 
+    public void persistBrokerConf(Properties from) {
+        BufferedReader reader = null;
+        try {
+            readWriteLock.readLock().lockInterruptibly();
+            String fileName = this.getStorePath();
+            File file = new File(fileName);
+            if (!file.exists()) {
+                file.createNewFile();
+            }
+            Properties properties = new Properties();
+            reader = new BufferedReader(new InputStreamReader(new 
FileInputStream(file), StandardCharsets.UTF_8));
+            properties.load(reader);
+            merge(from, properties);
+            final String str = MixAll.properties2String(properties);
+            MixAll.string2File(str, fileName);
+        } catch (Exception e) {
+            log.error("persist brokerConf error", e);

Review Comment:
   Thanks for your review,i will fix 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to