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 2022/11/10 06:31:47 UTC

[GitHub] [pulsar-client-python] gkimes opened a new issue, #37: Python PulsarClient::create_reader() doesn't accept MessageId instance

gkimes opened a new issue, #37:
URL: https://github.com/apache/pulsar-client-python/issues/37

   Python pulsar-client package
   
   **Describe the bug**
   Attempting to provide the function `PulsarClient::create_reader()` with the param `start_message_id` as an instance of `pulsar.MessageId` raises an error. It only accepts a `_pulsar.MessageId`, which is the [internal implementation of MessageId](https://github.com/apache/pulsar/blob/master/pulsar-client-cpp/python/pulsar/__init__.py#L123). 
   
   **To Reproduce**
   
   ```python
       import pulsar 
       
       pulsar_client = pulsar.Client(
           PULSAR_URL,
           authentication=pulsar.AuthenticationToken(PULSAR_TOKEN),
       )
       message_id = pulsar.MessageId(ledger_id=LEDGER_ID, entry_id=ENTRY_ID)
       pulsar_client.create_reader(TOPIC, message_id)
   ```
   
   ```
   Traceback (most recent call last):
       ... # my code
       pulsar_client.create_reader(TOPIC, message_id)
     File "/opt/conda/envs/base/lib/python3.8/site-packages/pulsar/__init__.py", line 825, in create_reader
       _check_type(_pulsar.MessageId, start_message_id, 'start_message_id')
     File "/opt/conda/envs/base/lib/python3.8/site-packages/pulsar/__init__.py", line 1338, in _check_type
       raise ValueError("Argument %s is expected to be of type '%s' and not '%s'"
   ValueError: Argument start_message_id is expected to be of type 'MessageId' and not 'MessageId'
   ```
   
   **Expected behavior**
   Should allow a `pulsar.MessageId` instance to be provided. Current workaround is to either access the private property `message_id._msg_id`, or serialize & deserialize to get a _pulsar.MessageId instance. 
   
   [Here is the line that performs the instance check and throws the error.](https://github.com/apache/pulsar/blob/master/pulsar-client-cpp/python/pulsar/__init__.py#L834)
   
   **Versions**
   - pulsar-client==2.10.0
   - Python 3.8.13
   
   


-- 
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: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-python] BewareMyPower closed issue #37: Python PulsarClient::create_reader() doesn't accept MessageId instance

Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower closed issue #37: Python PulsarClient::create_reader() doesn't accept MessageId instance
URL: https://github.com/apache/pulsar-client-python/issues/37


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-python] BewareMyPower commented on issue #37: Python PulsarClient::create_reader() doesn't accept MessageId instance

Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on issue #37:
URL: https://github.com/apache/pulsar-client-python/issues/37#issuecomment-1479086648

   Close it by https://github.com/apache/pulsar-client-python/pull/95


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org