frankvicky commented on code in PR #23115:
URL: https://github.com/apache/kafka/pull/23115#discussion_r4526073927


##########
clients/src/main/java/org/apache/kafka/clients/consumer/Consumer.java:
##########
@@ -56,8 +56,12 @@ public interface Consumer<K, V> extends Closeable {
     void subscribe(Collection<String> topics);
 
     /**
+     * @deprecated Since 4.5. Use {@link 
#setRebalanceListener(RebalanceListener)} followed by

Review Comment:
   nit: `KafkaConsumer` and `ConsumerRebalanceListener` say "Since 4.5, to be 
removed in Kafka 5.0." Could we use the same wording here and on the two 
overloads below for consistency?



##########
clients/src/main/java/org/apache/kafka/clients/consumer/MockConsumer.java:
##########
@@ -189,6 +189,7 @@ public synchronized void subscribe(Collection<String> 
topics) {
     }
 
     @Override
+    @SuppressWarnings("removal")

Review Comment:
   Since `MockConsumer` is public API, could we also add `@Deprecated(since = 
"4.5", forRemoval = true)` on these three overrides (here, L206 and L220)? 
   Without it, a call made through a `MockConsumer`-typed reference resolves to 
this declaration and gets no warning. 



##########
clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerRebalanceListener.java:
##########
@@ -133,9 +133,12 @@
  * }
  * </pre>
  *
+ * @deprecated Since 4.5, to be removed in Kafka 5.0. Use {@link 
RebalanceListener} and register it via
+ *             {@link Consumer#setRebalanceListener(RebalanceListener)} 
instead.
  * @see RebalanceListener
  * @see RebalanceConsumer
  */
+@Deprecated(since = "4.5", forRemoval = true)

Review Comment:
   nit: the example at L112 still does `new ConsumerRebalanceListener() {...}`. 
   Now that the interface is deprecated for removal, it would be better for the 
example to instantiate `RebalanceListener` instead.
   The callbacks it shows already use the 2-arg signature, so only the type 
name needs to change.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to