You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/06/30 02:59:54 UTC

[GitHub] [rocketmq] shengminw commented on a diff in pull request #4521: [ISSUE#4520] [Optimization] Implenment adjusting maxMessageSize dynamicly

shengminw commented on code in PR #4521:
URL: https://github.com/apache/rocketmq/pull/4521#discussion_r910563214


##########
store/src/main/java/org/apache/rocketmq/store/CommitLog.java:
##########
@@ -604,6 +604,14 @@ private String generateKey(StringBuilder keyBuilder, MessageExt messageExt) {
         return keyBuilder.toString();
     }
 
+    public void updateMaxMessageSize(PutMessageThreadLocal putMessageThreadLocal) {
+        // dynamically adjust maxMessageSize, but not support DLedger mode temporarily
+        int newMaxMessageSize = this.defaultMessageStore.getMessageStoreConfig().getMaxMessageSize();
+        if (putMessageThreadLocal.getEncoder().getMaxMessageBodySize() != newMaxMessageSize) {
+            putMessageThreadLocal.getEncoder().updateEncoderBufferCapacity(newMaxMessageSize);
+        }

Review Comment:
   ok, it's neccessary to add this check.



-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org