> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kafka source

> Configuration reference for `KafkaSourceDescription` properties such as `topics-to-include`, `topics-to-exclude`, and `accepts-topic-overrides`, defined under the `dlc.messaging.kafka` namespace.

<Note>
  DLC provides a default `KafkaSourceDescription` with the name `defaultKafkaSourceDesc` if no Kafka source has been defined.
</Note>

### Configuration properties

Properties for a Kafka Source are defined by name in the `dlc.messaging.kafka` namespace,
and are picked up as configurations for the DLC.

| Key                     | Required | Type          | Description                                                                                                  |
| ----------------------- | :------: | ------------- | ------------------------------------------------------------------------------------------------------------ |
| topics-to-include       |          | `Set<String>` | Topics to include. See [source to topic matching](/functional/source-to-topic-matching).                     |
| topics-to-exclude       |          | `Set<String>` | Topics to exclude. See [source to topic matching](/functional/source-to-topic-matching).                     |
| accepts-topic-overrides |          | `Boolean`     | Whether this source is allowed to accept Topic Overrides in the [Load Request](/operations/operations-load). |

#### YAML example

```yaml theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
dlc:
  messaging:
    kafka:
      sources:
        MyKafkaSource:
          topics-to-exclude:
            - Topic1
          topics-to-include:
            - Topic2
          accepts-topic-overrides: true
```

### Java configuration

`KafkaSourceDescription` Spring Beans are picked up as configurations for the DLC.

| Parameter             | Required | Type          | Description                                                                                                  |
| --------------------- | :------: | ------------- | ------------------------------------------------------------------------------------------------------------ |
| name                  |     Y    | `String`      | Name of the source.                                                                                          |
| topicsToInclude       |          | `Set<String>` | Topics to include. See [source to topic matching](/functional/source-to-topic-matching).                     |
| topicsToExclude       |          | `Set<String>` | Topics to exclude. See [source to topic matching](/functional/source-to-topic-matching).                     |
| acceptsTopicOverrides |          | `Boolean`     | Whether this source is allowed to accept Topic Overrides in the [Load Request](/operations/operations-load). |

#### Java example

```java theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
@Bean
public KafkaSourceDescription kafkaSourceDescription(){
	return KafkaSourceDescription.builder("KafkaSource")
			.topicsToExclude(Set.of("Topic1"))
			.topicsToInclude(Set.of("Topic2"))
			.acceptsTopicOverrides(true)
			.build();
}
```
