mxsm commented on code in PR #5048:
URL: https://github.com/apache/rocketmq/pull/5048#discussion_r968209106


##########
broker/src/main/java/org/apache/rocketmq/broker/util/HookUtils.java:
##########
@@ -74,12 +74,7 @@ public static PutMessageResult 
checkBeforePutMessage(BrokerController brokerCont
         final byte[] topicData = 
msg.getTopic().getBytes(MessageDecoder.CHARSET_UTF8);
         final int topicLength = topicData == null ? 0 : topicData.length;
 
-        if (topicLength > 
brokerController.getMessageStoreConfig().getMaxTopicLength()) {
-            LOG.warn("putMessage message topic[{}] length too long {}", 
msg.getTopic(), topicLength);
-            return new PutMessageResult(PutMessageStatus.MESSAGE_ILLEGAL, 
null);
-        }
-
-        if (topicLength > Byte.MAX_VALUE) {
+        if (topicLength > Byte.MAX_VALUE || topicLength > 
brokerController.getMessageStoreConfig().getMaxTopicLength()) {

Review Comment:
   if remove `topicLength > Byte.MAX_VALUE` and config file set `maxTopicLength 
= 1000`. broker will can not save。 So I think it is necessary.
   @RongtongJin @Oliverwqcwrw 



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