AndrewJSchofield commented on code in PR #14773:
URL: https://github.com/apache/kafka/pull/14773#discussion_r1395324636


##########
clients/src/main/java/org/apache/kafka/clients/consumer/Consumer.java:
##########
@@ -78,10 +79,14 @@ public interface Consumer<K, V> extends Closeable {
     void unsubscribe();
 
     /**
-     * @see KafkaConsumer#poll(long)
+     * @deprecated Since 2.0. Use {@link #poll(Duration)}, which does not 
block beyond the timeout awaiting partition
+     *             assignment. See <a 
href="https://cwiki.apache.org/confluence/x/5kiHB";>KIP-266</a> for more 
information.
+     * @see KafkaConsumer#poll(Duration)
      */
     @Deprecated
-    ConsumerRecords<K, V> poll(long timeout);
+    default ConsumerRecords<K, V> poll(long timeout) {
+        throw new KafkaException("This version of poll() is no longer 
supported. See KIP-266 (https://cwiki.apache.org/confluence/x/5kiHB) for more 
information.");

Review Comment:
   I think we cannot do this in AK 3.7 for the existing consumer. I suggest 
that the exception is thrown in `AsyncKafkaConsumer` only and the behaviour 
remains unchanged for the legacy consumer.



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

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to