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

后端 未结 8 1544
南旧
南旧 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:46

    ForHDP kafka use broker port: 6667

    For Standalone kafka use broker port: 9092

    The error was because of the port no which we were using (HDP uses 6667 but we were using 9092)

    bin/kafka-console-producer.sh --broker-list broker-ip:9092 --topic test //not working

    bin/kafka-console-producer.sh --broker-list broker-ip:6667 --topic test //working

    link: Kafka console producer Error in Hortonworks HDP 2.3 Sandbox

提交回复
热议问题