问题
I want to mirror some topics from one broker to another. Just part of all topics. There's an existed MirrorMaker tool for this. But I also want to change destination topic names. Also, Custom message handler already does it. Nevertheless, it doesn't fit my needs.
There are several requirements for me:
- mirror topics with the possibility to provide overrides for each destination topic
- detect new source topics on the fly
- Run it a standalone application (f.e. Java, Spring Boot) instead of CLI approach
Does anybody have ideas at least for one of them?
回答1:
As far as I know, there is no existing tool that does all the things you mention. Confluent's Replicator probably has all that functionality, but you'd have to pay for an Enterprise license. More details here:
https://www.confluent.io/connector/confluent-kafka-replicator/
My recommendation, if you don't want to pay for the Confluent license, is to build your own application that both consumes and produces info Kafka. You'd have full control, you can write it in Java, you can implement whatever logic you want (detect new topics automatically, change names dynamically on the destination topics, etc), and you can deploy it as a normal JVM application in whatever way suits you most (normal JVM, AWS EC2, Docker/Kubernetes app, etc)
来源:https://stackoverflow.com/questions/53067041/mirror-kafka-topics-with-custom-configuration-as-a-standalone-application