You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/02/01 09:06:53 UTC

[GitHub] ivankelly commented on a change in pull request #1136: Read compacted consumer flag

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

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/api/ConsumerConfiguration.java
 ##########
 @@ -270,6 +272,23 @@ 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.
+     *
+     * @param readCompacted whether to read from the compacted topic
+     */
+    public ConsumerConfiguration setReadCompacted(boolean readCompacted) {
 
 Review comment:
   In what I have now, it only works with subs with a single active consumer [1]. I don't see why it couldn't work with multiple active consumers though, the mechanism for reading should be fairly similar.
   
   [1] https://github.com/ivankelly/incubator-pulsar/blob/54964897c91ec972d9ac3fbbbd096e41e028cec6/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java#L300

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services