Apache Kafka example error: Failed to send message after 3 tries

后端 未结 8 1413
南旧
南旧 2021-02-19 08:39

I am running this kafka producer example mentioned in its site

The code:

public class TestProducer {

    public static void main(String[] args) {
               


        
8条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-19 09:35

    This can happen if the client cannot reach BOTH hostname and IP of the kafka broker.

    Make an entry to the clients \etc\hosts or C:\Windows\System32\drivers\etc\hosts and that resolved this issue for me.

提交回复
热议问题