How to replicate schema with Kafka mirror maker?

Viewed 2521

We are using the mirror maker to sync on-premise and AWS Kafka topics. How can a topic with its schema registered in on-premise be replicated exactly the same in other clusters (AWS in this case)? How Avro schema is replicated using mirror maker?

1 Answers

MirrorMaker only copies byte arrays, not schemas. And doesn't care about the format of the data

As of Confluent 4.x or later, this shouldn't matter as long your destination registry can lookup GET /schemas/ids/(number) for the same schema ID, as this is the endpoint the deserializer picks up

You otherwise can mirror the _schemas topic as well, as recommend by Confluent when using Confluent Replicator

If you absolutely need one-to-one schema copying, you would need to implement a MessageHandler interface, and pass this on to the MirrorMaker command, to get and post the schema, similar to the internal logic I added to this Kafka Connect plugin (which you could use Connect instead of MirrorMaker). https://github.com/cricket007/schema-registry-transfer-smt

Related