shengminw opened a new issue, #4520:
URL: https://github.com/apache/rocketmq/issues/4520
## [Optimization] Implenment adjusting maxMessageSize dynamicly
After broker was started, we can still modify the broker's configuration
parameters, including maxMessageSize, through tools like mqadmin.
However, after the maxMessageSize parameter is modified, since the buffer
used for encoding in CommitLog has been initialized, it does not actually take
effect.
Currently, encode bytebuff is fixed and can't be modify after initialized.
```java
private final ByteBuf byteBuf;
// The maximum length of the message body.
private final int maxMessageBodySize;
// The maximum length of the full message.
private final int maxMessageSize;
MessageExtEncoder(final int maxMessageBodySize) {
ByteBufAllocator alloc = UnpooledByteBufAllocator.DEFAULT;
//Reserve 64kb for encoding buffer outside body
int maxMessageSize = maxMessageBodySize + 64 * 1024;
byteBuf = alloc.directBuffer(maxMessageSize);
this.maxMessageBodySize = maxMessageBodySize;
this.maxMessageSize = maxMessageSize;
}
```
So, I consider to add interface to modify buffer capacity, and implenment
adjusting maxMessageSize dynamicly through checking maxMessageSize before
encoding bytebuf.
--
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]