You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "dartiga (via GitHub)" <gi...@apache.org> on 2023/01/27 07:12:39 UTC

[GitHub] [beam] dartiga commented on issue #25184: [Feature Request]: Use `partitionsFor` instead of `listTopics` in `ReadFromKafkaDoFn`

dartiga commented on issue #25184:
URL: https://github.com/apache/beam/issues/25184#issuecomment-1406110008

   So instead of
   ```java
   for (List<PartitionInfo> topicPartitionList : consumer.listTopics().values()) {
       topicPartitionList.forEach(
           partitionInfo -> {
             existingTopicPartitions.add(
                 new TopicPartition(partitionInfo.topic(), partitionInfo.partition()));
           });
   }
   ```
   Have something like:
   ```java
   List<PartitionInfo> topicPartitionList =
             consumer.partitionsFor(kafkaSourceDescriptor.getTopicPartition().topic());
   topicPartitionList.forEach(
       partitionInfo -> {
            existingTopicPartitions.add(
                 new TopicPartition(partitionInfo.topic(), partitionInfo.partition()));
       });
   ```


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org