BewareMyPower opened a new pull request #9287:
URL: https://github.com/apache/pulsar/pull/9287


   Fixes #9176 
   
   ### Motivation
   
   Currently Python producer's send method returns nothing. However, it should 
returns a `MessageId` at least. 
   
   So instead of using the current `Producer::send` API, this PR
   *Explain here the context, and why you're making that change. What is the 
problem you're trying to solve.*
   
   ### Modifications
   
   - Add a new `Producer#send` API with an extra argument as the output 
argument of `MessageId`.
   - Improve the `Producer#send` related documents to ensure these methods can 
link to each other in Doxygen-generated websites.
   - Let Python client's `Producer#send` return a `MessageId`.
   - Add related tests.
   
   It should be noted that the current C++ `Producer::send`'s API design is 
strange and weird that it returns no `MessageId` explicitly. However it will 
set the input `Message`'s internal `MessageId` field and there're no document 
about it, as well as the tests.
   
   This API design is extremely terrible. I think without looking into the 
source code, no one could guess that the input **const** `Message` argument 
will **modify** its internal field after `send` is completed. So I add a new 
`send` method as a substitute and mark the old `send` method deprecated.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change added tests and can be verified as follows:
   
   - C++: `ProducerTest#testSynchronouslySend`
   - Python: `PulsarTest.test_producer_send`
   
   ### Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (**yes**)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes)
     - If yes, how is the feature documented? (JavaDocs)
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to