mattisonchao commented on code in PR #20337:
URL: https://github.com/apache/pulsar/pull/20337#discussion_r1196208742


##########
pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawBatchConverter.java:
##########
@@ -139,8 +142,22 @@ public static Optional<RawMessage> 
rebatchMessage(RawMessage msg,
 
                 ByteBuf metadataAndPayload = 
Commands.serializeMetadataAndPayload(Commands.ChecksumType.Crc32c,
                                                                                
   metadata, compressedPayload);
-                Optional<RawMessage> result = Optional.of(new 
RawMessageImpl(msg.getMessageIdData(),
-                                                                             
metadataAndPayload));
+
+                if (brokerEntryMetadata != null) {
+                    int brokerMetaSize = 
brokerEntryMetadata.getSerializedSize();
+                    ByteBuf brokerMeta =
+                            
PulsarByteBufAllocator.DEFAULT.buffer(brokerMetaSize + 6, brokerMetaSize + 6);
+                    brokerMeta.writeShort(Commands.magicBrokerEntryMetadata);
+                    brokerMeta.writeInt(brokerMetaSize);
+                    brokerEntryMetadata.writeTo(brokerMeta);
+
+                    CompositeByteBuf compositeByteBuf = 
PulsarByteBufAllocator.DEFAULT.compositeBuffer();

Review Comment:
   Oh, it just affects the compacted message. The message number shouldn't be 
significant. It's fine here.



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