codelipenghui commented on code in PR #21311: URL: https://github.com/apache/pulsar/pull/21311#discussion_r1368512187
########## pip/pip-304.md: ########## @@ -0,0 +1,85 @@ +# Motivation + +We have a scenario that uses the `org.apache.pulsar.broker.intercept.BrokerInterceptor#messageProduced`, and need to +obtain the `org.apache.pulsar.common.api.proto.MessageMetadata`, but the `org.apache.pulsar.broker.service.Topic.PublishContext` doesn't provide this data. + +I will obtain the following data from the `org.apache.pulsar.common.api.proto.MessageMetadata`: + +- getPublishTime +- getEventTime +- getDeliverAtTime +- getPartitionKey + +# Goals + +## In Scope + +Make `org.apache.pulsar.broker.service.Topic.PublishContext` to provide the `org.apache.pulsar.common.api.proto.MessageMetadata`. Review Comment: But this does not have a compatibility guarantee. A performance optimization in the future may cause the buffer to be released early, and relying on the buffer here will make it almost difficult to optimize in the future. We need to go back to the essence of the problem(Should publish context rely on the buffer) and think about it. If we shouldn't rely on the buffer but now is false, we should improve it, instead of continuing in the opposite direction -- 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]
