codelipenghui commented on a change in pull request #14556:
URL: https://github.com/apache/pulsar/pull/14556#discussion_r819461418
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractBaseDispatcher.java
##########
@@ -145,9 +145,10 @@ public int
filterEntriesForConsumer(Optional<EntryWrapper[]> entryWrapper, int e
MessageMetadata msgMetadata = entryWrapper.isPresent() &&
entryWrapper.get()[entryWrapperIndex] != null
? entryWrapper.get()[entryWrapperIndex].getMetadata()
: null;
- msgMetadata = msgMetadata == null
- ? Commands.peekMessageMetadata(metadataAndPayload,
subscription.toString(), -1)
- : msgMetadata;
+ if (msgMetadata == null) {
Review comment:
Ok, looks like we should try our best to avoid passing the
MessageMetadata to another method, If we have to pass it to another method, we
should make a copy.
For example
https://github.com/apache/pulsar/blob/7cbd8493fa7b93c95e39fe406e960caebf093cd8/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java#L854
Use deliverAtTime is enough.
--
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]