ivankelly commented on a change in pull request #1136: Read compacted consumer 
flag
URL: https://github.com/apache/incubator-pulsar/pull/1136#discussion_r166268535
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/api/ConsumerConfiguration.java
 ##########
 @@ -270,6 +272,27 @@ public void setPriorityLevel(int priorityLevel) {
         this.priorityLevel = priorityLevel;
     }
 
+    public boolean getReadCompacted() {
+        return readCompacted;
+    }
+
+    /**
+     * If enabled, the consumer will read messages from the compacted topic 
rather than reading the full message
+     * backlog of the topic. This means that, if the topic has been compacted, 
the consumer will only see the latest
+     * value for each key in the topic, up until the point in the topic 
message backlog that has been compacted.
+     * Beyond that point, the messages will be sent as normal.
+     *
+     * readCompacted can only be enabled subscriptions to persistent topics, 
which have a single active consumer
+     * (i.e. failure or exclusive subscriptions). Attempting to enable it on 
subscriptions to a non-persistent
+     * topics or on a shared subscription, will lead to the subscription call 
throwing a PulsarClientException.
+     *
+     * @param readCompacted whether to read from the compacted topic
+     */
+    public ConsumerConfiguration setReadCompacted(boolean readCompacted) {
 
 Review comment:
   I doubt there'd be any more client flags around read compacted. Even if 
there were, I don't see that an enum would be better here. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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