提交 49a8658c 编写于 作者: B Brian Candler 提交者: Matteo Merli

Add is_read_compacted to create_reader() in python API (#5483)

Fixes #5365
上级 c59a37b2
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册