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 2020/05/14 02:58:05 UTC

[GitHub] [rocketmq] coder-zzzz commented on a change in pull request #1985: [ISSUE 1976] system topic should not be create or delete by user

coder-zzzz commented on a change in pull request #1985:
URL: https://github.com/apache/rocketmq/pull/1985#discussion_r424843127



##########
File path: broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java
##########
@@ -285,7 +273,19 @@ private synchronized RemotingCommand updateAndCreateTopic(ChannelHandlerContext
 
         this.brokerController.registerIncrementBrokerData(topicConfig, this.brokerController.getTopicConfigManager().getDataVersion());
 
-        return null;
+        response.setCode(ResponseCode.SUCCESS);
+        return response;
+    }
+
+    private boolean isSystemTopic(RemotingCommand response, String topic) {
+        if (this.brokerController.getTopicConfigManager().isSystemTopic(topic)) {
+            String errorMsg = "the topic[" + topic + "] is conflict with system reserved words.";
+            log.warn(errorMsg);

Review comment:
       errorMsg used in log and response's remark, so it is better to use a local var to store 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.

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