close

[Solved] org.apache.kafka.common.errors.TimeoutException: Topic not present in metadata after 60000 ms

Hello Guys, How are you all? Hope You all Are Fine. Today I am facing the following error org.apache.kafka.common.errors.TimeoutException: Topic not present in metadata after 60000 ms in Java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How org.apache.kafka.common.errors.TimeoutException: Topic not present in metadata after 60000 ms Error Occurs?

Today I am facing the following error org.apache.kafka.common.errors.TimeoutException: Topic not present in metadata after 60000 ms in Java.

How To Solve org.apache.kafka.common.errors.TimeoutException: Topic not present in metadata after 60000 ms Error ?

  1. How To Solve org.apache.kafka.common.errors.TimeoutException: Topic not present in metadata after 60000 ms Error ?

    To Solve org.apache.kafka.common.errors.TimeoutException: Topic not present in metadata after 60000 ms Error I was having this same problem today. I'm a newbie at Kafka and was simply trying to get a sample Java producer and consumer running.

  2. org.apache.kafka.common.errors.TimeoutException: Topic not present in metadata after 60000 ms

    To Solve org.apache.kafka.common.errors.TimeoutException: Topic not present in metadata after 60000 ms Error I was having this same problem today. I'm a newbie at Kafka and was simply trying to get a sample Java producer and consumer running.

Solution 1

I was having this same problem today. I’m a newbie at Kafka and was simply trying to get a sample Java producer and consumer running. I was able to get the consumer working, but kept getting the same “topic not present in metadata” error as you, with the producer.

Finally, out of desperation, I added some code to my producer to dump the topics. When I did this, I then got runtime errors because of missing classes in packages jackson-databind and jackson-core. After adding them, I no longer got the “topic not present” error. I removed the topic-dumping code I temporarily added, an it still worked.

Solution 2


First off I want to say thanks to Bobb Dobbs for his answer, I was also struggling with this for a while today. I just want to add that the only dependency I had to add is jackson-databind. This is the only dependency I have in my project, besides kafka-clients.

Update: I’ve learned a bit more about what’s going on. kafka-clients sets the scope of its jackson-databind dependency as “provided,” which means it expects it to be provided at runtime by the JDK or a container.

This scope is used to mark dependencies that should be provided at runtime by JDK or a container, hence the name. A good use case for this scope would be a web application deployed in some container, where the container already provides some libraries itself.

I’m not sure the exact reasoning on setting its scope to provided, except that maybe this library is something people normally would want to provide themselves to keep it up to the latest version for security fixes, etc.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read