merlimat commented on a change in pull request #7416:
URL: https://github.com/apache/pulsar/pull/7416#discussion_r448339719



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractBaseDispatcher.java
##########
@@ -153,13 +155,18 @@ public void resetCloseFuture() {
         PulsarApi.MessageMetadata metadata = 
Commands.parseMessageMetadata(metadataAndPayload);
 
         try {
-            if (metadata.hasNumMessagesInBatch()) {
+            if (!metadata.hasOrderingKey() && !metadata.hasPartitionKey() && 
metadata.hasNumMessagesInBatch()) {
                 // If the message was part of a batch (eg: a batch of 1 
message), we need
                 // to read the key from the first single-message-metadata entry
+                PulsarApi.CompressionType compressionType = 
metadata.getCompression();
+                CompressionCodec codec = 
CompressionCodecProvider.getCompressionCodec(compressionType);

Review comment:
       We should avoid decompressing in the broker in any case. This is very 
dangerous from a CPU usage point of view.




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

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


Reply via email to