codelipenghui commented on a change in pull request #7416: URL: https://github.com/apache/pulsar/pull/7416#discussion_r448363006
########## 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: Make sense, so it's better to revert #7107 and other lang clients should attach the routing key on the message metadata. ---------------------------------------------------------------- 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