Schema Registry Replication
Configure schema replication to target cluster.
To execute K2K, you must agree to the EULA and secure a free license.
Accept the EULA by setting license.acceptEula to true .
K2K supports migrating schemas from a source cluster to a destination cluster. This page covers the configuration steps required to enable this feature. For now K2K supports Schema Registries compatible with Confluent Schema Registry API.
This tutorial assumes the following files exist (See Setting up for more details):
To ensure a clean start, execute this command to reset any prior configurations from earlier tutorials.
Creating the source cluster topic
Execute these commands to create the "user-topic" topic and add data:
#create a topic
docker compose exec kafka-source \
./opt/kafka/bin/kafka-topics.sh \
--create \
--topic user-topic \
--partitions 5 \
--bootstrap-server 127.0.0.1:9092
#add some data and register the schema
docker compose exec -it registry-source \
kafka-avro-console-producer \
--bootstrap-server kafka-source:9092 \
--topic user-topic \
--property schema.registry.url="http://registry-source:8085" \
--property key.schema='{"type":"record","name":"userKey","fields":[{"name":"id","type":"int"}]}' \
--property value.schema='{"type":"record","name":"userRecord","fields":[{"name":"user_name","type":"string"}]}'
#paste this message
{"user_name": "my-name"}Repeat with different routing strategies
When replicating schemas, K2K considers the record routing strategy. Thus, if you repeat the steps with different routing strategies, such as appending a suffix to the topic name, the replicated subjects will be named according to the routing rule.
For more information about record routing refer to: (Routing Records)
Last updated
Was this helpful?

