简体   繁体   中英

Exactly once in confluent_kafka v0.11.2 for Python

How do I enable.idempotency or change the processing.guarantee to exactly_once in python3.6 for confluent kafka v0.11.4. A lot of documentation from confluent kafka only talks about Scala and Java. I tried doing something like this:

p = Producer({
        'bootstrap.servers':'localhost:9092',
        'processing.guarantee' : 'exactly_once'
    })

But I got this exception:

cimpl.KafkaException: KafkaError{code=_INVALID_ARG,val=-186,str="No such 
configuration property: "processing.guarantee""}

Any suggestions?

I do not know how this works specifically for Python, but you can only get exactly once delivery with Kafka if you're using Kafka Streams (leverating the transactions api). If you're not using the Kafka Streams library, exactly once is not available (or possible).

Learn more about how this works here: confluent.io/blog/enabling-exactly-kafka-streams

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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