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


##########
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 don't know why it was 5 at the first, so I think it's better to keep 
things as they are, and avoid any compatibility issues. 



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

Reply via email to