Skip to main content

Remove topic prefix when replicating with Apache Kafka® MirrorMaker 2

When you use Apache Kafka® MirrorMaker 2 to replicate topics across Apache Kafka® clusters, the default target topic name uses this format: <SOURCE_CLUSTER_ALIAS>.<TOPIC_NAME>. For example, if the source Apache Kafka cluster alias is src-kafka, replicating the orders source topic creates the src-kafka.orders target topic.

For most use cases, the extra prefix is not an issue. If you use a backup Apache Kafka cluster for disaster recovery, you might need consumers and producers to switch clusters with minimal downtime and without changing topic names in their configuration.

  1. Log in to the Aiven Console and click the Aiven for Apache Kafka MirrorMaker 2 service.
  2. Click Replication flows.
  3. Open the replication flow to update.
  4. In Replication policy class, replace the default org.apache.kafka.connect.mirror.DefaultReplicationPolicy value with org.apache.kafka.connect.mirror.IdentityReplicationPolicy.