RongtongJin commented on code in PR #5048:
URL: https://github.com/apache/rocketmq/pull/5048#discussion_r968178398
##########
store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java:
##########
@@ -239,7 +239,7 @@ public class MessageStoreConfig {
private boolean recheckReputOffsetFromCq = false;
// Maximum length of topic
- private int maxTopicLength = 1000;
+ private int maxTopicLength = 127;
Review Comment:
It would be better to use `Byte.MAX_VALUE` to represent 127
##########
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:
How about removing `topicLength > Byte.MAX_VALUE`?
--
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]