From 49a8658cac4b8f842feae9a00ad3b2480c7916ac Mon Sep 17 00:00:00 2001 From: Brian Candler Date: Mon, 28 Oct 2019 16:16:30 +0000 Subject: [PATCH] Add is_read_compacted to create_reader() in python API (#5483) Fixes #5365 --- pulsar-client-cpp/python/pulsar/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pulsar-client-cpp/python/pulsar/__init__.py b/pulsar-client-cpp/python/pulsar/__init__.py index af9c0d698f3..70576661b2d 100644 --- a/pulsar-client-cpp/python/pulsar/__init__.py +++ b/pulsar-client-cpp/python/pulsar/__init__.py @@ -594,6 +594,8 @@ class Client: * `broker_consumer_stats_cache_time_ms`: Sets the time duration for which the broker-side consumer stats will be cached in the client. + * `is_read_compacted`: + Selects whether to read the compacted version of the topic * `properties`: Sets the properties for the consumer. The properties associated with a consumer can be used for identify a consumer at broker side. @@ -663,7 +665,8 @@ class Client: reader_listener=None, receiver_queue_size=1000, reader_name=None, - subscription_role_prefix=None + subscription_role_prefix=None, + is_read_compacted=False ): """ Create a reader on a particular topic @@ -711,6 +714,8 @@ class Client: Sets the reader name. * `subscription_role_prefix`: Sets the subscription role prefix. + * `is_read_compacted`: + Selects whether to read the compacted version of the topic """ _check_type(str, topic, 'topic') _check_type(_pulsar.MessageId, start_message_id, 'start_message_id') @@ -718,6 +723,7 @@ class Client: _check_type(int, receiver_queue_size, 'receiver_queue_size') _check_type_or_none(str, reader_name, 'reader_name') _check_type_or_none(str, subscription_role_prefix, 'subscription_role_prefix') + _check_type(bool, is_read_compacted, 'is_read_compacted') conf = _pulsar.ReaderConfiguration() if reader_listener: @@ -728,6 +734,7 @@ class Client: if subscription_role_prefix: conf.subscription_role_prefix(subscription_role_prefix) conf.schema(schema.schema_info()) + conf.read_compacted(is_read_compacted) c = Reader() c._reader = self._client.create_reader(topic, start_message_id, conf) -- GitLab