Repository navigation
[Python] Return MessageId in producer's synchronous send method - #9287
Merged
sijie merged 2 commits intoJan 25, 2021
Merged
Conversation
jiazhai
approved these changes
Jan 23, 2021
sijie
approved these changes
Jan 23, 2021
BewareMyPower
force-pushed
the
bewaremypower/fix-cpp-send-api
branch
from
January 23, 2021 04:54
d45c17a to
25e1b04
Compare
Contributor
Author
|
/pulsarbot run-failure-checks |
1 similar comment
Contributor
Author
|
/pulsarbot run-failure-checks |
315157973
approved these changes
Jan 25, 2021
sijie
approved these changes
Jan 25, 2021
codelipenghui
pushed a commit
that referenced
this pull request
Feb 19, 2021
Fixes #9176 ### Motivation Currently Python producer's send method returns nothing. However, it should returns a `MessageId` at least. ### 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. (cherry picked from commit 0e6bbc8)
Member
|
Doc is added and avaliable at here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #9176
Motivation
Currently Python producer's send method returns nothing. However, it should returns a
MessageIdat least.Modifications
Producer#sendAPI with an extra argument as the output argument ofMessageId.Producer#sendrelated documents to ensure these methods can link to each other in Doxygen-generated websites.Producer#sendreturn aMessageId.It should be noted that the current C++
Producer::send's API design is strange and weird that it returns noMessageIdexplicitly. However it will set the inputMessage's internalMessageIdfield 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
Messageargument will modify its internal field aftersendis completed. So I add a newsendmethod as a substitute and mark the oldsendmethod deprecated.Verifying this change
This change added tests and can be verified as follows:
ProducerTest#testSynchronouslySendPulsarTest.test_producer_sendDoes this pull request potentially affect one of the following parts:
Documentation