[ https://issues.apache.org/jira/browse/KAFKA-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14632213#comment-14632213 ]
Onur Karaman commented on KAFKA-2275: ------------------------------------- Just to make sure we're on the same page: https://reviews.apache.org/r/36590/diff/1/ does not address the original concern of the jira. It provides the PartitionInfo related only to the topics passed into partitionsFor. I think the intent of listTopics() and what I poorly tried to convey earlier was that we need to have a way to get a global view of all topics and TopicPartitions in the cluster -- even we don't know any of the topics in the cluster. This is useful if we want to do explicit group management (partition-based subscriptions), but we don't know upfront all the TopicPartitions we want to consume. The API would let us periodically check on the global view of the TopicPartitions so we can adjust the partitions we subscribed to. > Add a ListTopics() API to the new consumer > ------------------------------------------ > > Key: KAFKA-2275 > URL: https://issues.apache.org/jira/browse/KAFKA-2275 > Project: Kafka > Issue Type: Sub-task > Components: consumer > Reporter: Guozhang Wang > Assignee: Ashish K Singh > Priority: Critical > Fix For: 0.8.3 > > Attachments: KAFKA-2275.patch > > > With regex subscription like > {code} > consumer.subscribe("topic*") > {code} > The partition assignment is automatically done at the Kafka side, while there > are some use cases where consumers want regex subscriptions but not > Kafka-side partition assignment, rather with their own specific partition > assignment. With ListTopics() they can periodically check for topic list > changes and specifically subscribe to the partitions of the new topics. > For implementation, it involves sending a TopicMetadataRequest to a random > broker and parse the response. -- This message was sent by Atlassian JIRA (v6.3.4#6332)