booksSchema Registry Replication

Configure schema replication to target cluster.

circle-exclamation

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):

name: "my-first-replication"
features:
  autoCreateControlTopics: enabled
  autoCreateTopics: enabled
source:
  kafka:
    common:
      "bootstrap.servers": "kafka-source:9092"
    consumer:
      "group.id": "k2k.my-first-k2k"
target:
  kafka:
    common:
      "bootstrap.servers": "kafka-target:9092"
replication:
  - source:
      topic: ".*"
  - sink:
      topic: source
      partition: source

To ensure a clean start, execute this command to reset any prior configurations from earlier tutorials.

1

Start the Kafka clusters

2

Creating the source cluster topic

Execute these commands to create the "user-topic" topic and add data:

3

Run it

Use the following command to run the K2K replicator app:

triangle-exclamation
4

Validating results

K2K now replicates both data and schemas. Querying the subjects endpoint on the target schema registry will display identical schemas as those on the source.

5

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)

Was this helpful?