You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python Client Producer Synchronous Send Void Return Value #9176
Is your enhancement request related to a problem? Please describe.
A clear and concise description of what the enhancement is.
It seems as though the Python client producer has void return values for all of its functions. The relevant file is here. Because of how the Python package is a wrapper of the C++ one, I'm not sure if this is doable, but it would make sense for at least the send method to return something. For example, the synchronous send method should preferably return the MessageID of the message sent. If a producer client wants to know the MessageID of the delivered message in a synchronous manner, the only way it seems possible now is to use send_async and register a callback function, and then flush to ensure it waits until all messages in the queue are acknowledged.
Describe the solution you'd like
A clear and concise description of what you want to happen.
For the Python client producer send method to have a useful return value.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Currently building an app where we'd like to know the MessageID of the message just recently sent to a topic, and use that MessageID as the value of a field in other topics.
I just found that the current C++ send API design is strange that though msg is const, the MessageId will be stored in msg and user can get message id by msg.getMessageId() after send returns. But the document didn't explain it.
Anyway, Python client doesn't expose the Message so user cannot get message id.
I'll add the new API of Producer::send to let Python client get the message id and improve the docs.
Activity
[-]Python Client Synchronous Send Void Return Value[/-][+]Python Client Producer Synchronous Send Void Return Value[/+]BewareMyPower commentedon Jan 12, 2021
Yes, it's also a problem of C++ client that synchronous send can't retrieve the message id. It's an issue of the initial API design.
The fix may change the API, I'm not sure if it's proper. A simple fix that keeps the compatibility may be adding a overload method to
Producer::send:BewareMyPower commentedon Jan 22, 2021
I just found that the current C++ send API design is strange that though
msgisconst, theMessageIdwill be stored inmsgand user can get message id bymsg.getMessageId()aftersendreturns. But the document didn't explain it.Anyway, Python client doesn't expose the
Messageso user cannot get message id.I'll add the new API of
Producer::sendto let Python client get the message id and improve the docs.[Python] Return MessageId in producer's synchronous send method (#9287)
[Python] Return MessageId in producer's synchronous send method (#9287)