I am working on a scala application in which I am using kafka. I want to retrieve topic names from my code. My code is as follows:
def getTopic = {
metadataClient.listTopics().map(x => logger.info(s"topic - $x"))
}
And I am calling this method from my main class. On running it is not giving any errors. But When I call this method and store result in a val and print it. it says Future(<not completed>)
. Also it is not printing value of x. How can I correct it.