kafka-reo
The tool to replicate data between different Apache Kafka clusters with exactly-once delivery.
639
Kafka Replicator Exactly-Once - the tool to replicate data with exactly-once guarantee between different clusters of Apache Kafka.
More in Confluent docs.
All these tools can provide only either at-most-once or at-least-once delivery.
Apache Kafka has transactional API, which can be used for exactly-once delivery. The fundamental idea is to commit consumer offset and producer records in a single transaction. Kafka Streams uses it to provide high-level abstraction and easy access to exactly-once benefits. It may be enabled literally without code change, with one config option.
This works only within the same Kafka cluster.
Replication tools from the list above are not compatible with exactly-once delivery. The reason is in such case consumer offsets and producer records live in different clusters. Apache Kafka can't wrap operations with different clusters in one transaction. There is Kafka Improvement Proposal how to make it possible and good reading about it, but it exists from 2020 and nothing of it is implemented in 2023.
It requires more than 2x resources as compared with just at-least-once replication, but does the job.

Set your bootstrap servers and topic name for both clusters and run:
docker run \
-e KAFKA_CLUSTERS_SOURCE_BOOTSTRAP_SERVERS=source-kafka-cluster:9092 \
-e KAFKA_CLUSTERS_SOURCE_TOPIC=source-topic \
-e KAFKA_CLUSTERS_DESTINATION_BOOTSTRAP_SERVERS=destination-kafka-cluster:9092 \
-e KAFKA_CLUSTERS_DESTINATION_TOPIC=destination-topic \
emitskevich/kafka-reo
See instructions in GitHub repo.
Launch as close to destination cluster as possible. It has notable performance boost, since the step of deduplication uses transactional API of destination cluster and is latency-sensible.
Content type
Image
Digest
sha256:711222c1f…
Size
164.2 MB
Last updated
almost 2 years ago
docker pull emitskevich/kafka-reo