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/25 11:17:26 UTC

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

duhenglucky commented on a change in pull request #1985:
URL: https://github.com/apache/rocketmq/pull/1985#discussion_r429879894



##########
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)) {

Review comment:
       It would be better to integrate the two methods: org.apache.rocketmq.common.MixAll#isSystemTopic 

##########
File path: broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java
##########
@@ -252,29 +253,16 @@ private synchronized RemotingCommand updateAndCreateTopic(ChannelHandlerContext
             (CreateTopicRequestHeader) request.decodeCommandCustomHeader(CreateTopicRequestHeader.class);
         log.info("updateAndCreateTopic called by {}", RemotingHelper.parseChannelRemoteAddr(ctx.channel()));
 
-        if (requestHeader.getTopic().equals(this.brokerController.getBrokerConfig().getBrokerClusterName())) {
-            String errorMsg = "the topic[" + requestHeader.getTopic() + "] is conflict with system reserved words.";

Review comment:
       the -> The




----------------------------------------------------------------
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