fuyou001 commented on code in PR #5611:
URL: https://github.com/apache/rocketmq/pull/5611#discussion_r1039116456


##########
common/src/main/java/org/apache/rocketmq/common/message/MessageExtBrokerInner.java:
##########
@@ -27,6 +27,8 @@ public class MessageExtBrokerInner extends MessageExt {
 
     private ByteBuffer encodedBuff;
 
+    private MessageVersion version = MessageVersion.MESSAGE_VERSION_V1;
+

Review Comment:
   version default null  may be safe.



##########
common/src/main/java/org/apache/rocketmq/common/message/MessageExtBrokerInner.java:
##########
@@ -27,6 +27,8 @@ public class MessageExtBrokerInner extends MessageExt {
 
     private ByteBuffer encodedBuff;
 
+    private MessageVersion version = MessageVersion.MESSAGE_VERSION_V1;

Review Comment:
   version default null may be safe.



##########
broker/src/main/java/org/apache/rocketmq/broker/util/HookUtils.java:
##########
@@ -72,8 +73,14 @@ public static PutMessageResult 
checkBeforePutMessage(BrokerController brokerCont
         }
 
         final byte[] topicData = 
msg.getTopic().getBytes(MessageDecoder.CHARSET_UTF8);
+        boolean retryTopic = msg.getTopic() != null && 
msg.getTopic().startsWith(MixAll.RETRY_GROUP_TOPIC_PREFIX);
+        if (!retryTopic && topicData.length > Byte.MAX_VALUE) {
+            LOG.warn("putMessage message topic[{}] length too long {}, but it 
is not supported by broker",
+                msg.getTopic(), topicData.length);
+            return new PutMessageResult(PutMessageStatus.MESSAGE_ILLEGAL, 
null);
+        }
 
-        if (topicData.length > Byte.MAX_VALUE) {
+        if (retryTopic && topicData.length > 255) {

Review Comment:
   magic code



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