3
我可以寫信給卡夫卡。然而,消費不工作用於消費的蟒蛇卡夫卡不起作用
kafka = KafkaClient(kafka_host_list)
consumer = SimpleConsumer(kafka,'topic-test-development','topic-test-development')
No handlers could be found for logger "kafka.conn"
Traceback (most recent call last):
File "/home/ubuntu/workspace/feed-tests/tests/kafka_consumer.py", line 44, in <module>
consumer = SimpleConsumer(kafka,'topic-test-development','topic-test-development')
File "/usr/local/lib/python2.7/dist-packages/kafka/consumer/simple.py", line 126, in __init__
auto_commit_every_t=auto_commit_every_t)
File "/usr/local/lib/python2.7/dist-packages/kafka/consumer/base.py", line 75, in __init__
self.fetch_last_known_offsets(partitions)
File "/usr/local/lib/python2.7/dist-packages/kafka/consumer/base.py", line 101, in fetch_last_known_offsets
check_error(resp)
File "/usr/local/lib/python2.7/dist-packages/kafka/common.py", line 230, in check_error
raise response
kafka.common.FailedPayloadsError
看來,經紀人不可用.... – BAE
python kafka客戶端的版本是什麼? doc中有一個介紹:group:該用戶的名稱,用於偏移量存儲,並且必須是唯一的 如果要連接到不支持偏移量 commit/fetch(任何在0.8.1.1之前)的服務器,則你*必須*設置爲無(從:https://github.com/mumrah/kafka-python/blob/adbd4ac052e4a5b40cfc2a3589b7adbcb656afe5/kafka/consumer/simple.py) – BAE
我對卡夫卡和蟒蛇卡夫卡包裝經驗是經紀人連接是片狀的,這意味着當生產者嘗試發送消息或消費者試圖將消息標記爲消費時,可以重置連接。你最好的選擇是實施一個重試邏輯,因爲我認爲這個問題很快就會得到解決。我仍然看到他們在這裏和那裏彈出。 – adam