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


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:
##########
@@ -487,6 +488,16 @@ public void onSubscriptionUpdated() {
      * active call to {@link 
org.apache.kafka.clients.consumer.KafkaConsumer#poll(Duration)}"
      */
     public void onConsumerPoll() {
+        if (subscriptions.hasPatternSubscription()) {
+            final Set<String> topicsToSubscribe = 
metadata.fetch().topics().stream()
+                .filter(subscriptions::matchesSubscribedPattern)
+                .collect(Collectors.toSet());
+            if (subscriptions.subscribeFromPattern(topicsToSubscribe)) {
+                metadata.requestUpdateForNewTopics();
+            }
+            subscriptionUpdated.compareAndSet(false, true);
+        }

Review Comment:
   I've revised the regex subscription check as we've discussed. PTAL. Thanks!



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