This is an automated email from the ASF dual-hosted git repository.

xyz pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/pulsar-client-python.git

commit 1248825ef2c74b28cbea3f9f811c1ffbb3f16172
Author: Eric Hare <ericrh...@gmail.com>
AuthorDate: Thu Feb 16 08:18:33 2023 -0700

    Issue #37 : Allow passing pulsar.MessageId instance to create_reader() (#95)
    
    (cherry picked from commit 2aaacad8b13f2498a47d35554a7eec19a7579be2)
---
 pulsar/__init__.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pulsar/__init__.py b/pulsar/__init__.py
index 0ce2e4b..b1b8a9d 100644
--- a/pulsar/__init__.py
+++ b/pulsar/__init__.py
@@ -882,6 +882,11 @@ class Client:
             Symmetric encryption class implementation, configuring public key 
encryption messages for the producer
             and private key decryption messages for the consumer
         """
+        
+        # If a pulsar.MessageId object is passed, access the _pulsar.MessageId 
object
+        if isinstance(start_message_id, MessageId):
+            start_message_id = start_message_id._msg_id
+
         _check_type(str, topic, 'topic')
         _check_type(_pulsar.MessageId, start_message_id, 'start_message_id')
         _check_type(_schema.Schema, schema, 'schema')

Reply via email to