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/06/09 06:04:44 UTC

[GitHub] [pulsar] eolivelli commented on a diff in pull request #15993: [client][python] Add support for consumer get_last_message_id

eolivelli commented on code in PR #15993:
URL: https://github.com/apache/pulsar/pull/15993#discussion_r893101568


##########
pulsar-client-cpp/python/pulsar_test.py:
##########
@@ -486,6 +486,23 @@ def test_consumer_is_connected(self):
         self.assertFalse(consumer.is_connected())
         client.close()
 
+    def test_consumer_get_last_message_id(self):
+        client = Client(self.serviceUrl)
+        topic = "test_consumer_get_last_message_id"
+        sub = "sub"
+        consumer = client.subscribe(topic, sub)
+
+        producer = client.create_producer(topic)
+
+        for i in range(10):
+            producer.send(b"hello-%d" % i)
+            message_id = consumer.get_last_message_id()

Review Comment:
   we should add a test with a empty topic
   
   possibly we should cover the case of a truncated topic, but I am not sure we have a API to truncate a topic in python. not a blocker



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