kecona commented on PR #21311:
URL: https://github.com/apache/pulsar/pull/21311#issuecomment-1775139031

   I can accept the above two options:
   
   1.  This is a solution without waiting for a new feature version release 
because we should not cherry-pick any APIs changes to LTS version and patch 
release.
   2. 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. 
   
   
   > But you can have a cache for metadata of the inflight messages, the key 
can be (topic, producerId, sequence) and the value is metadata, after the 
message is published, just retrieve it from the cache. 
   
   This is a good way to solve my problem, although it requires depending on a 
cache.
   
   We can move the `headersAndPayload` to 
`org.apache.pulsar.broker.service.Producer.MessagePublishContext` and when the 
publish operation is finished we can call the 
`org.apache.pulsar.broker.service.Producer.MessagePublishContext#recycle` to 
recycle the `headersAndPayload`, I think this is a good 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]

Reply via email to