You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by du...@apache.org on 2022/03/03 03:18:43 UTC

[rocketmq] branch develop updated: [#3903] Add topic validation, forbid sending message to system topic (#3904)

This is an automated email from the ASF dual-hosted git repository.

duhengforever pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new 5ae4a10  [#3903] Add topic validation, forbid sending message to system topic  (#3904)
5ae4a10 is described below

commit 5ae4a106bdd83848ae12e870e8f0f587bd107500
Author: sunxi92 <su...@163.com>
AuthorDate: Thu Mar 3 11:17:39 2022 +0800

    [#3903] Add topic validation, forbid sending message to system topic  (#3904)
    
    * Forbid sending message to system topic.
    
    * Forbid sending message to system topic.The topic RMQ_SYS_TRACE_TOPIC should be excluded.
---
 .../main/java/org/apache/rocketmq/common/topic/TopicValidator.java   | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/common/src/main/java/org/apache/rocketmq/common/topic/TopicValidator.java b/common/src/main/java/org/apache/rocketmq/common/topic/TopicValidator.java
index c0525fa..d4a9d80 100644
--- a/common/src/main/java/org/apache/rocketmq/common/topic/TopicValidator.java
+++ b/common/src/main/java/org/apache/rocketmq/common/topic/TopicValidator.java
@@ -58,6 +58,11 @@ public class TopicValidator {
         SYSTEM_TOPIC_SET.add(RMQ_SYS_OFFSET_MOVED_EVENT);
 
         NOT_ALLOWED_SEND_TOPIC_SET.add(RMQ_SYS_SCHEDULE_TOPIC);
+        NOT_ALLOWED_SEND_TOPIC_SET.add(RMQ_SYS_TRANS_HALF_TOPIC);
+        NOT_ALLOWED_SEND_TOPIC_SET.add(RMQ_SYS_TRANS_OP_HALF_TOPIC);
+        NOT_ALLOWED_SEND_TOPIC_SET.add(RMQ_SYS_TRANS_CHECK_MAX_TIME_TOPIC);
+        NOT_ALLOWED_SEND_TOPIC_SET.add(RMQ_SYS_SELF_TEST_TOPIC);
+        NOT_ALLOWED_SEND_TOPIC_SET.add(RMQ_SYS_OFFSET_MOVED_EVENT);
 
         // regex: ^[%|a-zA-Z0-9_-]+$
         // %