Kafka : Failed to update metadata after 60000 ms with only one broker down
Posting the answer for someone who might face this issue -
The reason is older version of Kafka Producer. The kafka producers take bootstrap servers as list. In older versions, for fetching metadata, producers will try to connect with all the servers in Round Robin fashion. So, if one of the broker is down, the requests going to this server will fail and this message will come.
Solution:
- Upgrade to newer producer version.
- can reduce metadata.fetch.timeout.ms settings: This will ensure the main thread is not getting blocked and send will fail soon. Default value is 60000ms. Not needed in higher version
Note: Kafka send method is blocked till the producer is able to write to buffer.
org.apache.kafka.common.errors.TimeoutException: Topic not present in metadata after 60000 ms
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.
In apache Kafka, who would populate the RecordMetadata and where does this information reside once the producer got it?
You have no records, so it's actually topic metadata.
As answered on your previous question, you'll get these logs if you cannot connect to the bootstrap addresses.
Zookeeper holds topic metadata
I'm getting Topic not present in metadata after 60000 ms message on some computers
192.168.10.10:9092
This seems to be an internal IP. Check if the clients where you cannot access are within its network range i.e. whether they can access this IP.
Try doing a telnet from your client machine..
telnet 192.168.10.10 9092
If you are not able to telnet
then give the IP which can be accessed by your clients and ensure the same in the advertised.listeners
also.
Also check your advertised.listeners
config. When we connect to a url given in the bootstrap.servers
that typically should par with those in the advertised.listeners
configuration.
Topic metadata not present means that your client is unable to fetch any information about the given topic i.e. it cannot get metadata through the given bootstrap.servers
property.
Related Topics
Gson Expected Begin_Array But Was String At Line 1 Column 62
Regular Expression to Match a Backslash Followed by a Quote
How to Encrypt a String/Stream With Bouncycastle Pgp Without Starting With a File
Batch Inserts Using JPA Entitymanager
Webdriver/Pageobject/Findby: How to Specify Xpath With Dynamic Value
How to Get an Http Response Body as a String
Spring JPA Repository: Prevent Update on Save
Forward Httpservletrequest to a Different Server
How to Listen With Multiple Port for Multiple Client in Single Jpos Instance
How Find Given Number Is Octal or Not
Cannot Find Element Using Selenium Webdriver
Enable Jackson Deserialization of Empty Objects to Null
How to Force Java Server to Accept Only Tls 1.2 and Reject Tls 1.0 and Tls 1.1 Connections
Type Safety: Unchecked Cast from Object to Arraylist<Myvariable>
How to Find Out the Exact Requested Url in Servletrequest If That Url Contains Path Variables
Hibernate Foreign Key Issue:Error Executing Ddl "Alter Table..."
Method to Find the Smallest Number from an Integer
Java Error - Illegal Modifier for Parameter - Only Final Permitted