MarvinCai commented on a change in pull request #12720:
URL: https://github.com/apache/pulsar/pull/12720#discussion_r749890992
##########
File path:
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
##########
@@ -479,6 +479,13 @@ public void sendAsync(Message<?> message, SendCallback
callback) {
}
String uuid = totalChunks > 1 ? String.format("%s-%d",
producerName, sequenceId) : null;
for (int chunkId = 0; chunkId < totalChunks; chunkId++) {
+ // Need to reset the schemaVersion, because the
schemaVersion is a ByteBuf object in
+ // `MessageMetadata`, if we want to re-serialize the
`SEND` command using a same `MessageMetadata`,
+ // we need to reset the ByteBuf of the schemaVersion in
`MessageMetadata`, I think we need to
+ // reset `ByteBuf` objects in `MessageMetadata` after call
the method `MessageMetadata#writeTo()`.
+ if (chunkId > 0 &&
msg.getMessageBuilder().hasSchemaVersion()) {
Review comment:
seems getSchemaVersion() will copy data around, might be good if we just
store the result as it won't change
--
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]