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


##########
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:
   > IMO, we should deprecate maxTopicLength config and comment on it, and 
finally remove this config in the future release.
   
   I prefer this approach. I will resubmit code to fix 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to