Replicate a whole cluster

Configure K2K to replicate every topic from a Kafka cluster to another.

name: "cluster-replicator"
source:
  kafka:
    connection:
      servers: "sourceKafka:9092"
    consumer:
      "group.id": "k2k.cluster-replicator.source"
target:
  kafka:
    connection:
      servers: "targetKafka:9092"
replication:
  - source:
      name: topic-source
      # Use a regex .* to replicate all topics found
      topic: ".*"
  - sink:
      name: topic-sink
      # use the original topic name as the target topic
      topic: source
      # replicate each message to the same partition as the
      # original topic 
      partition: source
coordination:
  kafka:
    commit:
      # set the consumer group name for reading data 
      # from the source Kafka.
      group: "k2k.cluster-replicator.coordination"  
features:
  # Optional. Use it to ensure that every message is only replicated once.
  # If you don't need it, disable it for better performance.
  exactlyOnce: enabled

Last updated

Was this helpful?