首页 > 解决方案 > ruby-kafka: is it possible to publish to two kafka instances at the same time

问题描述

Current flow of the project that I'm working on involves pushing to a local kafka using ruby-kafka gem.
Now the need arose to add producer for the remote kafka, and duplicate also messages there.
And I'm looking for a better way, than calling Kafka.new(...) twice...
Could you please help me, and do you happen to have any ideas?

标签: rubyapache-kafkakafka-producer-apiruby-kafka

解决方案


Another approach to consider would be writing the data once from your application, and then asynchronously replicating the message from one Kafka cluster to another. There are multiple ways of doing this including Apache Kafka's MirrorMaker, Confluent's Replicator, Uber's uReplicator etc.

Disclaimer: I work for Confluent.


推荐阅读