codelipenghui commented on code in PR #21311:
URL: https://github.com/apache/pulsar/pull/21311#discussion_r1368035272


##########
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

Review Comment:
   The method `BrokerInterceptor#onMessagePublish` already provided the 
`headersAndPayload`, you can retrieve the metadata from the 
`headersAndPayload`. Of course, I'm not saying we should not have message 
metadata in `BrokerInterceptor#messageProduced`, Just provide a way to retrieve 
the message metadata without new changes to Pulsar.



##########
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:
   The message metadata is not a part of `PublishContext`, we'd better not add 
the message metadata or headersAndPayload to the publish context because they 
have different recycling time. The headersAndPayload can be recycled after it 
has been written to bookies, don't need to wait for producer's receipt. But the 
PublishContext is for the producer's receipt. I think it also should be the 
reason why we don't add headersAndPayload to the method 
`BrokerInterceptor#messageProduced` but add it to 
`BrokerInterceptor#onMessagePublish`.



-- 
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]

Reply via email to