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/05 21:53:49 UTC

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

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

 ##########
 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:
   Can we expect more options to be needed at some point that we could need an enum rather than a flag?

----------------------------------------------------------------
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