# Configuration Reference

{% hint style="warning" %}
In order for the consumer offset mapping functionality to work, both of the following requirements must be met:

* K2K must be configured to publish offset mappings.
* The `k2k-offset-mapping` application must be configured and deployed.

Without both components active, consumer group offsets on the target cluster will not be translated.
{% endhint %}

## Feature Flags

<table><thead><tr><th width="304.8333740234375">Field</th><th width="710.5">Behavior/Description</th><th width="105.75006103515625" data-type="checkbox">Required</th><th>Default</th><th>Type</th></tr></thead><tbody><tr><td><code>features.autoCreateControlTopics</code></td><td>Enables creation of the necessary control topics used by the k2k application.</td><td>false</td><td><code>disabled</code></td><td><code>disabled</code>, <code>enabled</code></td></tr><tr><td><code>features.applyMappingsGuards</code></td><td>Enables/Disables the behavior described in <a data-mention href="/pages/m5w98wdtj5JBo4feLytO">/pages/m5w98wdtj5JBo4feLytO</a></td><td>false</td><td><code>enabled</code></td><td><code>disabled</code>, <code>enabled</code></td></tr></tbody></table>

## Pipeline

<table data-full-width="true"><thead><tr><th>Field</th><th width="289.6666259765625">Behavior/Description</th><th data-type="checkbox">Required</th><th>Default</th><th>Type</th></tr></thead><tbody><tr><td>name</td><td>name of the offset-mapping app</td><td>true</td><td></td><td><code>string</code></td></tr></tbody></table>

## License

<table data-full-width="true"><thead><tr><th>Field</th><th>Behavior/Description</th><th data-type="checkbox">Required</th><th>Default</th><th>Type</th></tr></thead><tbody><tr><td><code>license.acceptEula</code></td><td>It needs to be set to true to run the K2K application</td><td>true</td><td></td><td><code>boolean</code></td></tr><tr><td><code>license.token</code></td><td>A license key to enable premium features like exactly-once semantics <code>k2k@lenses.io</code></td><td>false</td><td></td><td><code>string</code></td></tr></tbody></table>

## Error Handling

<table data-full-width="true"><thead><tr><th width="431">Field</th><th width="223">Behavior/Description</th><th width="106.833251953125" data-type="checkbox">Required</th><th>Default</th><th>Type</th></tr></thead><tbody><tr><td><p><code>errorHandling.onMultipleTargetCommittedOffsets</code></p><p></p></td><td>Handles error behavior when multiple options exist for mapping of a record.</td><td>false</td><td><code>fail</code></td><td><code>fail</code>, <code>ignore</code></td></tr><tr><td><code>errorHandling.onActiveConsumerGroupCommit</code></td><td>Handles error behavior when a commit is attempted for a group with an active consumer.</td><td>false</td><td><code>fail</code></td><td><code>fail</code>, <code>ignore</code></td></tr></tbody></table>

## Group configuration

<table data-full-width="true"><thead><tr><th width="431">Field</th><th width="223">Behavior/Description</th><th width="106.833251953125" data-type="checkbox">Required</th><th>Default</th><th>Type</th></tr></thead><tbody><tr><td><p><code>groups.pollInterval</code></p><p></p></td><td>Interval between calls for consumer group details.</td><td>false</td><td><code>5 seconds</code></td><td><code>duration string</code></td></tr><tr><td><code>groups.consumerGroups</code></td><td>Filter that selects which consumer groups should be synced to the target cluster. Refer to <a data-mention href="/pages/eJ1TSZALYDg0rCcbyTVb">/pages/eJ1TSZALYDg0rCcbyTVb</a> for the detailed list of possibilities.</td><td>false</td><td><code>.*</code></td><td><code>list of string</code>,<code>regex</code></td></tr><tr><td><code>groups.offsetGuardPrefix</code></td><td>Prefix added to consumer group metadata offset guard.Refer to <a data-mention href="/pages/m5w98wdtj5JBo4feLytO">/pages/m5w98wdtj5JBo4feLytO</a> for more details</td><td>false</td><td><code>k2k_</code></td><td><code>string</code></td></tr></tbody></table>

## Offset Mapping

<table data-full-width="true"><thead><tr><th width="194">Field</th><th width="377">Behavior/Description</th><th width="106.833251953125" data-type="checkbox">Required</th><th>Default</th><th>Type</th></tr></thead><tbody><tr><td><p><code>offsetMapping.topic</code></p><p></p></td><td>Control topic used to read offset mapping information.</td><td>false</td><td><code>__k2k_offset_mappings</code></td><td><code>string</code></td></tr></tbody></table>

## Source Cluster Kafka

{% hint style="info" %}
Only the connection details are required in this section (bootstrap servers and credentials). Those can be provided in the `common` section and will be inherited by the other Kafka client configurations targeting this cluster.
{% endhint %}

<table data-full-width="true"><thead><tr><th width="413">Field</th><th width="666">Behavior/Description</th><th width="111" data-type="checkbox">Required</th><th width="92">Default</th><th>Type</th></tr></thead><tbody><tr><td><code>source.kafka.common</code></td><td>Common properties inherited by <code>consumer</code> and <code>admin</code> clients</td><td>true</td><td></td><td><code>object</code></td></tr><tr><td><code>source.kafka.admin</code></td><td>Common properties inherited by <code>consumer</code> and <code>admin</code> and <code>producer</code> clients.</td><td>false</td><td></td><td><code>object</code></td></tr></tbody></table>

## Target Cluster Kafka and Schema Registry Connection

{% hint style="info" %}
Only the connection details are required in this section (bootstrap servers and credentials). Those can be provided in the `common` section and will be inherited by the other Kafka client configurations targeting this cluster.
{% endhint %}

<table data-full-width="true"><thead><tr><th width="247.9166259765625">Field</th><th width="800">Behavior/Description</th><th width="112" data-type="checkbox">Required</th><th width="109">Default</th><th width="142.5001220703125">Type</th></tr></thead><tbody><tr><td><code>target.kafka.common</code></td><td>Common properties inherited by <code>consumer,</code> <code>admin</code>  and <code>producer</code> clients</td><td>true</td><td></td><td><code>object</code></td></tr><tr><td><code>target.kafka.producer</code></td><td>Kafka producer configuration used to produce metrics to the target cluster (if enabled)</td><td>false</td><td></td><td><code>object</code></td></tr><tr><td><code>target.kafka.admin</code></td><td>Kafka admin client configuration used to introspect the Kafka target cluster.</td><td>false</td><td></td><td><code>object</code></td></tr><tr><td><code>target.kafka.consumer</code></td><td>Kafka consumer configuration used to read offset mappings present in the Kafka target cluster.</td><td>false</td><td></td><td></td></tr></tbody></table>

## Metrics

<table data-full-width="true"><thead><tr><th width="358.6666259765625">Field</th><th>Behavior/Description</th><th width="119.5833740234375" data-type="checkbox">Required</th><th>Default</th><th width="176.5">Type</th></tr></thead><tbody><tr><td><code>metrics.prefix.targetConsumer</code></td><td>Prefix added to published metrics about the K2K Offset Mapping target consumer. </td><td>false</td><td><code>k2k.offsetmapping.consumer.control.</code></td><td><code>cluster</code> , <code>pipeline</code></td></tr><tr><td><code>metrics.prefix.targetProducer</code></td><td>Prefix added to published metrics about the K2K Offset Mapping target producer. </td><td>false</td><td><code>k2k.offsetmapping.producer.</code></td><td><code>enabled</code></td></tr><tr><td><code>metrics.prefix.offsetMappingApp</code></td><td>Prefix added to published metrics about the K2K Offset Mapping app. </td><td>false</td><td><code>k2k.offsetmapping.</code></td><td><code>enabled</code></td></tr></tbody></table>

## Control Topics Auto Creation&#x20;

{% hint style="info" %}
Only relevant if `features.autoCreateTopics`  is enabled.
{% endhint %}

<table data-full-width="true"><thead><tr><th width="436.5728759765625">Field</th><th width="493.8424072265625">Behavior / Description</th><th width="110.58349609375" data-type="checkbox">Required</th><th width="202.5">Default</th><th>Type</th></tr></thead><tbody><tr><td><code>topicCreation.control.common.partitions</code></td><td>Default partition count to be used when auto-creating any of the replicated topics.</td><td>false</td><td></td><td><code>integer</code></td></tr><tr><td><code>topicCreation.control.common.replication</code></td><td>Default replication to be used when auto-creating any of the replicated control topics.</td><td>false</td><td></td><td><code>short</code></td></tr><tr><td><code>topicCreation.control.common.config</code></td><td>Default topic configuration to be used when auto-creating any of the replicated control topics.</td><td>false</td><td>empty object</td><td><code>object</code></td></tr><tr><td><code>topicCreation.control.metrics.partitions</code></td><td>Default partition count to be used when creating the topic used for metrics.</td><td>false</td><td></td><td><code>integer</code></td></tr><tr><td><code>topicCreation.control.metrics.replication</code></td><td>Default replication to be used when creating the topic used for metrics.</td><td>false</td><td></td><td><code>integer</code></td></tr><tr><td><code>topicCreation.control.metrics.config</code></td><td>Default topic configuration to be used when creating the topic used for metrics.</td><td>false</td><td></td><td><code>object</code></td></tr><tr><td><code>topicCreation.control.offsetMapping.partitions</code></td><td>Default partition count to be used when auto-creating the offset-mappings topic.</td><td>false</td><td></td><td><code>integer</code></td></tr><tr><td><code>topicCreation.control.offsetMapping.replication</code></td><td>Default replication to be used when auto-creating the offset-mappings topic.</td><td>false</td><td></td><td><code>integer</code></td></tr><tr><td><code>topicCreation.control.offsetMapping.config</code></td><td>Default config to be used when auto-creating the offset-mappings topic.</td><td>false</td><td>object with <br><code>"cleanup.policy": "delete"</code></td><td><code>object</code></td></tr></tbody></table>

* If any of the properties `topicCreation.*.replication` and `topicCreation.*.partitions` is left blank (or set to null), K2K will default to the cluster default values for those properties.or control topics, the final topic configuration will be the result of merging the default/common value with the one specified in `topicCreation.control.common.config` and the one for the specific topic e.g: `topicCreation.control.commit.config`.
* For replicated topics, the final topic configuration will be the result of overriding the original topic's configuration with the result of merging the default/common value specified in `topicCreation.replication.common` with the one specified in the first matching rule in `topicCreation.replication.rules[]`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lenses.io/latest/k2k/k2k-offset-mapping/configuration-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
