Skip to content

python API missing is_read_compacted in create_reader() #5365

@candlerb

Description

@candlerb

Describe the bug

The python API has is_read_compacted in the Consumer API, but not in the Reader API.

I think this may be an accidental omission. I checked the Java API docs, both ConsumerBuilder and ReaderBuilder have readCompacted

Similarly, the C++ API has setReadCompacted in ReaderConfiguration.cc

To Reproduce

import pulsar

client = pulsar.Client('pulsar://localhost:6650')

msg_id = pulsar.MessageId.earliest

reader = client.create_reader('my-topic', msg_id, is_read_compacted=True)

while True:
    msg = reader.read_next()
    print("Received message %r id=%s" % (msg.data(), msg.message_id()))

Gives TypeError: create_reader() got an unexpected keyword argument 'is_read_compacted'

Expected behavior

To work the same as the consumer API. The following works:

consumer = client.subscribe('my-topic', 'my-subscription', is_read_compacted=True)

Desktop (please complete the following information):

  • OS: Ubuntu 18.04, Pulsar 2.4.1, python 3.6.8, and pulsar-client==2.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugThe PR fixed a bug or issue reported a bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions