jolshan commented on a change in pull request #9684: URL: https://github.com/apache/kafka/pull/9684#discussion_r564908486
########## File path: clients/src/main/java/org/apache/kafka/clients/admin/CreateTopicsResult.java ########## @@ -68,6 +69,19 @@ protected CreateTopicsResult(Map<String, KafkaFuture<TopicMetadataAndConfig>> fu return futures.get(topic).thenApply(TopicMetadataAndConfig::config); } + /** + * Returns a future that provides topic ID for the topic when the request completes. + * <p> + * If broker version doesn't support replication factor in the response, throw + * {@link org.apache.kafka.common.errors.UnsupportedVersionException}. + * If broker returned an error for topic configs, throw appropriate exception. For example, + * {@link org.apache.kafka.common.errors.TopicAuthorizationException} is thrown if user does not + * have permission to describe topic configs. + */ + public KafkaFuture<Uuid> topicId(String topic) { + return futures.get(topic).thenApply(TopicMetadataAndConfig::topicId); + } + /** * Returns a future that provides number of partitions in the topic when the request completes. Review comment: I think we could either do that or just return Uuid.ZERO_UUID ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org