1
產生卡夫卡我有這個模塊運行(所有地方):不能從Python代碼
- 的ZooKeeper
- 卡夫卡服務器
- 卡夫卡消費者
- Python腳本
在劇本有send()
電話:
producer = KafkaProducer(bootstrap_servers=['localhost:9092'])
producer.send('test', 'entry1')
每15秒左右。卡夫卡服務器上的幾乎每一個send()
調用產生這些錯誤:
[2017-10-16 18:59:10,953] ERROR Closing socket for /127.0.0.1 because of error (kafka.network.Processor)
kafka.common.KafkaException: Wrong request type 16
at kafka.api.RequestKeys$.deserializerForKey(RequestKeys.scala:64)
at kafka.network.RequestChannel$Request.<init>(RequestChannel.scala:50)
at kafka.network.Processor.read(SocketServer.scala:450)
at kafka.network.Processor.run(SocketServer.scala:340)
at java.lang.Thread.run(Thread.java:748)
[2017-10-16 18:59:11,158] INFO Closing socket connection to /127.0.0.1. (kafka.network.Processor)
[2017-10-16 18:59:11,162] INFO Closing socket connection to /127.0.0.1. (kafka.network.Processor)
[2017-10-16 18:59:11,162] ERROR Closing socket for /127.0.0.1 because of error (kafka.network.Processor)
kafka.common.KafkaException: Wrong request type 18
at kafka.api.RequestKeys$.deserializerForKey(RequestKeys.scala:64)
at kafka.network.RequestChannel$Request.<init>(RequestChannel.scala:50)
at kafka.network.Processor.read(SocketServer.scala:450)
at kafka.network.Processor.run(SocketServer.scala:340)
at java.lang.Thread.run(Thread.java:748)
這是一個幾乎,因爲每5個小步舞(或多或少)的條目也得到了消費者的權利,但隨後的錯誤返回。
感謝您的幫助
您正在使用哪個Kafka客戶端,以及哪個版本的Kafka?你試過這個嗎? https://github.com/confluentinc/confluent-kafka-python –