You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/01/11 15:09:53 UTC

[GitHub] [pulsar] Alxander64 opened a new issue #9176: Python Client Synchronous Send Void Return Value

Alxander64 opened a new issue #9176:
URL: https://github.com/apache/pulsar/issues/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](https://github.com/apache/pulsar/blob/master/pulsar-client-cpp/python/src/producer.cc). 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.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] BewareMyPower commented on issue #9176: Python Client Producer Synchronous Send Void Return Value

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on issue #9176:
URL: https://github.com/apache/pulsar/issues/9176#issuecomment-765349399


   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.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] BewareMyPower commented on issue #9176: Python Client Producer Synchronous Send Void Return Value

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on issue #9176:
URL: https://github.com/apache/pulsar/issues/9176#issuecomment-758340078


   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`:
   
   ```c++
       Result send(const Message& msg);  // the original API
   
       Result send(const Message& msg, MessageId& msgId);  // the new API
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] sijie closed issue #9176: Python Client Producer Synchronous Send Void Return Value

Posted by GitBox <gi...@apache.org>.
sijie closed issue #9176:
URL: https://github.com/apache/pulsar/issues/9176


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] sijie closed issue #9176: Python Client Producer Synchronous Send Void Return Value

Posted by GitBox <gi...@apache.org>.
sijie closed issue #9176:
URL: https://github.com/apache/pulsar/issues/9176


   


----------------------------------------------------------------
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:
users@infra.apache.org