简体   繁体   English

Kafka-python生产者enable.idempotent

[英]Kafka-python producer enable.idempotent

i'm facing the duplication data in kafka so i want to use idempotent in kafka-python but unfortunately its not the part of it, how i can stop the duplication data in same partition with out idempotent or there is any way to import it or customize the current library?我在 kafka 中面临重复数据,所以我想在 kafka-python 中使用幂等但不幸的是它不是它的一部分,我如何在没有幂等的情况下停止同一分区中的重复数据或者有任何方法可以导入它或自定义当前库? Thanks in advance.提前致谢。

You'd better use confluent_kafka, since kafka-python does not provide this feature.你最好使用 confluent_kafka,因为 kafka-python 不提供这个功能。 Have a look at this link看看这个链接

producer = Producer({'bootstrap.servers': ‘localhost:9092’,
          'enable.idempotence': True})

This feature was made available with the 1.0.0 release of librdkafka (a library written in C).此功能在 librdkafka(一个用 C 编写的库)的 1.0.0 版本中提供。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM