candlerb opened a new issue #5365: python API missing `is_read_compacted` in 
create_reader()
URL: https://github.com/apache/pulsar/issues/5365
 
 
   **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](https://pulsar.apache.org/api/client/org/apache/pulsar/client/api/ReaderBuilder.html#readCompacted-boolean-)
   
   Similarly, the C++ API has 
[setReadCompacted](https://github.com/apache/pulsar/blob/master/pulsar-client-cpp/lib/ReaderConfiguration.cc#L69)
 in 
[ReaderConfiguration.cc](https://github.com/apache/pulsar/blob/master/pulsar-client-cpp/lib/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
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to