Skip to content

Commit

Permalink
Forbid sending message to system topic.The topic RMQ_SYS_TRACE_TOPIC …
Browse files Browse the repository at this point in the history
…should be excluded.
  • Loading branch information
sunxi92 committed Mar 1, 2022
1 parent e5c21b7 commit 58647c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public static void checkMessage(Message msg, DefaultMQProducer defaultMQProducer
// topic
Validators.checkTopic(msg.getTopic());
Validators.isNotAllowedSendTopic(msg.getTopic());
Validators.isSystemTopic(msg.getTopic());

// body
if (null == msg.getBody()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_-]+$
// %
Expand Down

0 comments on commit 58647c0

Please sign in to comment.