// This module is included in:
//
// overview/assembly-configuration-points.adoc

[id="con-configuration-points-mm2-{context}"]
= Kafka MirrorMaker configuration

[role="_abstract"]
To set up MirrorMaker, a source and target (destination) Kafka cluster must be running.

You can use Strimzi with MirrorMaker 2.0, although the earlier version of MirrorMaker continues to be supported.

include::con-overview-mirrormaker2.adoc[leveloffset=+1]

[discrete]
=== Example YAML showing MirrorMaker 2.0 configuration

[source,yaml,subs="+quotes,attributes"]
----
  apiVersion: {KafkaMirrorMaker2ApiVersion}
  kind: KafkaMirrorMaker2
  metadata:
    name: my-mirror-maker2
    spec:
      version: {DefaultKafkaVersion}
      connectCluster: "my-cluster-target"
      clusters:
      - alias: "my-cluster-source"
        bootstrapServers: my-cluster-source-kafka-bootstrap:9092
      - alias: "my-cluster-target"
        bootstrapServers: my-cluster-target-kafka-bootstrap:9092
      mirrors:
      - sourceCluster: "my-cluster-source"
        targetCluster: "my-cluster-target"
        sourceConnector: {}
      topicsPattern: ".*"
      groupsPattern: "group1|group2|group3"
----

== MirrorMaker configuration

The earlier version of MirrorMaker uses producers and consumers to replicate data across clusters.

MirrorMaker uses:

* Consumer configuration to consume data from the source cluster
* Producer configuration to output data to the target cluster

Consumer and producer configuration includes any authentication and encryption settings.

The `include` field defines the topics to mirror from a source to a target cluster.

[discrete]
=== Key Consumer configuration

Consumer group identifier:: The consumer group ID for a MirrorMaker consumer so that messages consumed are assigned to a consumer group.
Number of consumer streams:: A value to determine the number of consumers in a consumer group that consume a message in parallel.
Offset commit interval:: An offset commit interval to set the time between consuming and committing a message.

[discrete]
=== Key Producer configuration

Cancel option for send failure:: You can define whether a message send failure is ignored or MirrorMaker is terminated and recreated.

[discrete]
=== Example YAML showing MirrorMaker configuration
[source,yaml,subs="+quotes,attributes"]
----
apiVersion: {KafkaMirrorMakerApiVersion}
kind: KafkaMirrorMaker
metadata:
  name: my-mirror-maker
spec:
  # ...
  consumer:
    bootstrapServers: my-source-cluster-kafka-bootstrap:9092
    groupId: "my-group"
    numStreams: 2
    offsetCommitInterval: 120000
    # ...
  producer:
    # ...
    abortOnSendFailure: false
    # ...
  include: "my-topic|other-topic"
  # ...
----
