philipnee commented on code in PR #14638:
URL: https://github.com/apache/kafka/pull/14638#discussion_r1372115691


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java:
##########
@@ -162,13 +162,13 @@ else if (this.subscriptionType != type)
             throw new IllegalStateException(SUBSCRIPTION_EXCEPTION_MESSAGE);
     }
 
-    public synchronized boolean subscribe(Set<String> topics, 
ConsumerRebalanceListener listener) {
+    public synchronized boolean subscribe(Set<String> topics, 
Optional<ConsumerRebalanceListener> listener) {

Review Comment:
   Another suggestion is to not change the interface, then we do:
   
   registerRebalanceListener(Optional.ofNullabe(listener)) - this prevents us 
to do a requireNonNull check.



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