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


##########
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);

Review Comment:
   Please help give a static name for the number 6. it's hard for developers to 
know what it is.



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