lhotari commented on code in PR #25555:
URL: https://github.com/apache/pulsar/pull/25555#discussion_r3117271181
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Producer.java:
##########
@@ -223,14 +229,19 @@ public void publishMessage(long producerId, long
lowestSequenceId, long highestS
});
return;
}
- if (checkAndStartPublish(producerId, highestSequenceId,
headersAndPayload, batchSize, position)) {
- publishMessageToTopic(headersAndPayload, lowestSequenceId,
highestSequenceId, batchSize, isChunked,
- isMarker, position);
+ MessagePublishContext messagePublishContext =
MessagePublishContext.get(this, lowestSequenceId,
+ highestSequenceId, headersAndPayload.readableBytes(),
batchSize,
+ isChunked, System.nanoTime(), isMarker, position,
isSupportsReplDedupByLidAndEid());
+ if (checkAndStartPublish(producerId, highestSequenceId,
headersAndPayload, batchSize, position,
+ messagePublishContext)) {
+ publishMessageToTopic(headersAndPayload, messagePublishContext);
+ } else {
+ messagePublishContext.recycle();
}
}
public boolean checkAndStartPublish(long producerId, long sequenceId,
ByteBuf headersAndPayload, int batchSize,
- Position position) {
+ Position position, PublishContext
publishContext) {
Review Comment:
It's very unlikely that this breaks anything so it should be fine to change
the method signature.
--
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]