NoBrokersAvailable: NoBrokersAvailable-Kafka Error

前端 未结 6 1226
南旧
南旧 2021-01-12 12:13

i have already started to learn Kafka. Trying basic operations on it. I have stucked on a point which about the \'Brokers\'.

My kafka is running but when i want to

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-12 13:08

    I had the same error during kafka streaming. The code below resolved my error: We need to define the API version in KafkaProducer.

    KafkaProducer(bootstrap_servers=['localhost:9092'],
                  api_version=(0,11,5),
                  value_serializer=lambda x: dumps(x).encode('utf-8'))
    

提交回复
热议问题