kirktrue commented on code in PR #14565:
URL: https://github.com/apache/kafka/pull/14565#discussion_r1370618922


##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -976,15 +1053,14 @@ public void subscribe(Collection<String> topics) {
      * Group rebalances only take place during an active call to {@link 
#poll(Duration)}.
      *
      * @param pattern Pattern to subscribe to
-     * @param listener Non-null listener instance to get notifications on 
partition assignment/revocation for the
-     *                 subscribed topics
+     * @param listener {@link Optional} listener instance to get notifications 
on partition assignment/revocation
+     *                 for the subscribed topics
      * @throws IllegalArgumentException If pattern or listener is null
      * @throws IllegalStateException If {@code subscribe()} is called 
previously with topics, or assign is called
      *                               previously (without a subsequent call to 
{@link #unsubscribe()}), or if not
      *                               configured at-least one partition 
assignment strategy
      */
-    @Override
-    public void subscribe(Pattern pattern, ConsumerRebalanceListener listener) 
{
+    private void subscribe(Pattern pattern, 
Optional<ConsumerRebalanceListener> listener) {
         maybeThrowInvalidGroupIdException();
         if (pattern == null || pattern.toString().equals(""))

Review Comment:
   Agreed. I'm loath to change it at this point due to some weird side effect 
of which I'm unaware.



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