new ConfigResource(ConfigResource.Type.TOPIC, "foo"))); time.sleep(5000); result2.values().get(new ConfigResource(ConfigResource.Type.TOPIC, "foo")).get();
/** * Get a topic config via the Kafka AdminClient API, calling the given handler * (in a different thread) with the result. */ @Override public void topicMetadata(TopicName topicName, Handler<AsyncResult<TopicMetadata>> handler) { LOGGER.debug("Getting metadata for topic {}", topicName); ConfigResource resource = new ConfigResource(ConfigResource.Type.TOPIC, topicName.toString()); KafkaFuture<TopicDescription> descriptionFuture = adminClient.describeTopics( Collections.singleton(topicName.toString())).values().get(topicName.toString()); KafkaFuture<Config> configFuture = adminClient.describeConfigs( Collections.singleton(resource)).values().get(resource); queueWork(new MetadataWork(descriptionFuture, configFuture, result -> handler.handle(result))); }