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/07/13 00:15:53 UTC

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

gkimes opened a new issue, #16555:
URL: https://github.com/apache/pulsar/issues/16555

   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] github-actions[bot] commented on issue #16555: Python PulsarClient::create_reader() doesn't accept MessageId instance

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #16555:
URL: https://github.com/apache/pulsar/issues/16555#issuecomment-1212663931

   The issue had no activity for 30 days, mark with Stale label.


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