kirktrue commented on code in PR #20521:
URL: https://github.com/apache/kafka/pull/20521#discussion_r2418089943
##########
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:
Let me know if the revised code is good and I'll mark this thread as
resolved. 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]