You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/02/10 15:13:17 UTC

[GitHub] [kafka] ijuma commented on a change in pull request #10096: KAFKA-12268: Make early poll return opt-in

ijuma commented on a change in pull request #10096:
URL: https://github.com/apache/kafka/pull/10096#discussion_r573811199



##########
File path: clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java
##########
@@ -71,6 +71,21 @@
     /** <code>max.poll.interval.ms</code> */
     public static final String MAX_POLL_INTERVAL_MS_CONFIG = CommonClientConfigs.MAX_POLL_INTERVAL_MS_CONFIG;
     private static final String MAX_POLL_INTERVAL_MS_DOC = CommonClientConfigs.MAX_POLL_INTERVAL_MS_DOC;
+
+    /** <code>long.poll.mode</code> */
+    public static final String LONG_POLL_RETURN_ON_RECORDS = "return_on_records";
+    public static final String LONG_POLL_RETURN_ON_RESPONSE = "return_on_response";
+    public static final String LONG_POLL_MODE_CONFIG = "long.poll.mode";
+    public static final String LONG_POLL_MODE_DOC = "Whether a call to Consumer#poll(...) should block until" +
+        " records are received (return_on_records), or should return early if a metadata-only response is received" +
+        " from the brokers (return_on_metadata). The 'return_on_records' mode is the default, and it matches prior" +
+        " behavior. The 'return_on_response' mode allows callers to witness topic metadata changes via" +
+        " ConsumerRecords#metadata() as soon as they are received in a fetch response, even if there are no records" +
+        " included in the response. Callers who are only interested in seeing records should leave the default in" +
+        " place, and callers who are interested in maintaining fresh local information about the current lag should" +
+        " enable 'return_on_response'." +
+        " Note that the Consumer metrics are always updated upon receipt of the fetch responses.";

Review comment:
       Hmm, this doesn't seem great.




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