:_mod-docs-content-type: CONCEPT

// Module included in the following assemblies:
//
// assembly-config.adoc

[id='con-mirrormaker-producers-consumers-{context}']
= Configuring MirrorMaker 2 connector producers and consumers

[role="_abstract"]
MirrorMaker 2 connectors use internal producers and consumers.
If required, you can configure these producers and consumers to override the default settings. 

For example, you can increase the `batch.size` for the source producer that sends topics to the target Kafka cluster to better accommodate large volumes of messages.

IMPORTANT: Producer and consumer configuration options depend on the MirrorMaker 2 implementation, and may be subject to change.  

The following tables describe the producers and consumers for each of the connectors and where you can add configuration. 

Configuration can be applied as follows:

* Overriding the configuration used by the internal producer or consumer by using the `producer.override.` or `consumer.override.` properties.
* Configuring the internal producer or consumer directly in the connector by using the `producer.` or `consumer.` properties.

.Source connector producers and consumers
[cols="1,2a,2m",options="header"]
|===

|Type
|Description
|Configuration

|Producer
|Sends replicated topic messages to the target Kafka cluster.
Tune this producer when handling large volumes of data.
|`producer.override.*`

|Producer
|Writes to the `offset-syncs` topic, which maps source and target offsets.
|`producer.*`

|Consumer
|Consumes topic messages from the source Kafka cluster.
|`consumer.*`

|===

.Checkpoint connector producers and consumers
[cols="1,2a,2m",options="header"]
|===

|Type
|Description
|Configuration

|Producer
|Emits consumer group offset checkpoints.
|`producer.override.*`

|Consumer
|Consumes data from the `offset-syncs` topic.
|`consumer.*`

|===

NOTE: You can set `offset-syncs.topic.location` to `target` to use the target Kafka cluster as the location of the `offset-syncs` topic.

The following example shows how you configure the producers and consumers. 

.Example configuration for connector producers and consumers
[source,yaml,subs="+quotes,attributes"]
----
apiVersion: {KafkaMirrorMaker2ApiVersion}
kind: KafkaMirrorMaker2
metadata:
  name: my-mirror-maker2
spec:
  version: {DefaultKafkaVersion}
  # ...
  mirrors:
  - source:
      # ...
    sourceConnector:
      tasksMax: 5
      config:
        producer.override.batch.size: 327680
        producer.override.linger.ms: 100
        producer.request.timeout.ms: 30000
        consumer.fetch.max.bytes: 52428800
        # ...
    checkpointConnector:
      config:
        producer.override.request.timeout.ms: 30000
        consumer.max.poll.interval.ms: 300000
        # ...
----