coderzc commented on code in PR #21917:
URL: https://github.com/apache/pulsar/pull/21917#discussion_r1458168546


##########
pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawBatchConverter.java:
##########
@@ -135,7 +135,8 @@ public static Optional<RawMessage> 
rebatchMessage(RawMessage msg,
                                                       
msg.getMessageIdData().getPartition(),
                                                       i);
                 if (!singleMessageMetadata.hasPartitionKey()) {
-                    if (retainNullKey) {
+                    // we may read compacted out message from compacted topic, 
which do not have partition key too.
+                    if (retainNullKey && 
!singleMessageMetadata.isCompactedOut()) {

Review Comment:
   Can we move the `isCompactedOut` judgment outside? 



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