Oliverwqcwrw commented on code in PR #5048:
URL: https://github.com/apache/rocketmq/pull/5048#discussion_r969047279
##########
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, The `topicLength > Byte.MAX_VALUE` can be removed regardless of whether
`maxTopicLength` is dynamically modifiable
--
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]