mattisonchao commented on code in PR #20337:
URL: https://github.com/apache/pulsar/pull/20337#discussion_r1197210204
##########
pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawBatchConverter.java:
##########
@@ -139,8 +149,15 @@ 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 (brokerMeta != null) {
+ CompositeByteBuf compositeByteBuf =
PulsarByteBufAllocator.DEFAULT.compositeDirectBuffer();
+ compositeByteBuf.addComponents(true, brokerMeta,
metadataAndPayload);
+ metadataAndPayload = compositeByteBuf;
Review Comment:
Should we release the previous metadataAndPayload `Bytebuf`?
--
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]