chia7712 commented on code in PR #24241:
URL: https://github.com/apache/kafka/pull/24241#discussion_r4669777350


##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -902,6 +902,12 @@ public void unsubscribe() {
      * the previous pattern of passing a listener to the {@code subscribe()} 
methods (which are now deprecated).
      *
      * <p>
+     * The listener can be registered on a consumer with or without group 
management, including a consumer
+     * without a {@code group.id}. It is invoked only while the consumer uses 
group management through
+     * {@code subscribe()}. A registered listener is retained when the 
consumer switches between
+     * {@code assign()} and {@code subscribe()}, so it takes effect once the 
consumer subscribes.
+     *
+     * <p>
      * The listener can be updated at any time. The change takes effect on the 
next {@link #poll(Duration)}

Review Comment:
   Would you mind updating this paragraph as well? The change takes effect 
immediately, so the other methods, like unsubscribe, will call the new listener 
even though poll is not executed.



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