Help Center/ MapReduce Service/ Developer Guide (Normal_3.x)/ Kafka Development Guide (Security Mode)/ FAQs in Kafka Application Development/ Running the Producer.java Sample Fails and "ERROR fetching topic metadata" Is Displayed
Updated on 2026-04-10 GMT+08:00
Running the Producer.java Sample Fails and "ERROR fetching topic metadata" Is Displayed
Symptom
The user has the topic access permission, but the error message "ERROR fetching topic metadata for topics..." is displayed when you run the Producer.java sample.
Troubleshooting Procedure
- Find bootstrap.servers in producer.properties under the conf directory of the project, and check whether the IP address and port ID are configured correctly.
- If the IP address is inconsistent with the service IP address of the Kafka cluster, change the IP address to the correct one.
- If the port ID is 21007 (security mode port), change it to 9092 (normal mode port).
- Check whether network connections are correct to ensure that the current device can access the Kafka cluster normally.
Parent topic: FAQs in Kafka Application Development
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot