2

慎用 kafka-python 客户端!!!存在双端丢数据的风险

 2 years ago
source link: https://segmentfault.com/a/1190000040854159
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

生产者丢数据

https://github.com/dpkp/kafka...

根据 smalyshev 的描述,当生产者循环不停的提交 message ,如果 kafka 宕机了,提交不会报错,还是会一直不停的提交,但是 kafka 已经宕机了不会接受消息呀,但是此事 kafka-python 却不会报错,还是一直提交,没提交上的就丢弃了。。。连个错误提示都不会有,站在程序员的角度来看,这个消息到底是提交成功还是提交失败的我们也不知道

消费者丢数据

这里说的消费者丢数据不是那种,而是因为 kafka-python 的 bug 导致的丢数据。

https://www.infoq.cn/article/...

大概的意思就是说 kafka-python 的迭代机制有问题,会导致取回来的数据在还没有消费之前就没了


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK