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/04/29 09:23:32 UTC

[GitHub] [rocketmq] tianliuliu commented on a diff in pull request #4213: [ISSUE #4203] Support zstd/lz4 compression to improve send/receive performance

tianliuliu commented on code in PR #4213:
URL: https://github.com/apache/rocketmq/pull/4213#discussion_r861637010


##########
common/src/main/java/org/apache/rocketmq/common/message/MessageDecoder.java:
##########
@@ -163,7 +166,8 @@ public static byte[] encode(MessageExt messageExt, boolean needCompress) throws
         int storehostAddressLength = (sysFlag & MessageSysFlag.STOREHOSTADDRESS_V6_FLAG) == 0 ? 8 : 20;
         byte[] newBody = messageExt.getBody();
         if (needCompress && (sysFlag & MessageSysFlag.COMPRESSED_FLAG) == MessageSysFlag.COMPRESSED_FLAG) {
-            newBody = UtilAll.compress(body, 5);
+            Compressor compressor = CompressorFactory.getCompressor(MessageSysFlag.getCompressionType(sysFlag));
+            newBody = compressor.compress(body, 5);

Review Comment:
   I also think System.getProperty(MixAll.MESSAGE_COMPRESS_LEVEL, "5") is better



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