> ## 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.

# Channel

> Configuration reference for `ChannelDescription`, which links a topic to a `Target` and optional `Custom Fields`, with an `accumulate` option for chunked messages.

### Configuration properties

Properties for the Channel are provided inside the configuration of a Topic.

| Key           | Required | Type          | Default | Description                                                                                                                                                           |
| ------------- | :------: | :------------ | :------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| target        |     Y    | `String`      |         | Name of the [Target](/configuration/target).                                                                                                                          |
| custom-fields |          | `Set<String>` |         | Set of names of the [Custom Fields](/configuration/custom-field).                                                                                                     |
| accumulate    |          | `boolean`     | false   | If enabled, the messages will accumulate all of their tuples (from all the message chunks) and only publish them to the transaction manager when the message is sent. |

#### YAML example

```yaml theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
dlc:
  csv:
    topics:
      topic1:
        channels:
          - target: target1
            custom-fields:
              - calculator1
              - calculator2
              - calculator3
              - calculator4
              - calculator5
```

### Java configuration

`ChannelDescription` Java object can be used for configuration in Java. The Object is used in the configuration of a
Topic.

Use `NamedEntityResolverService` to get Target or Column Calculator by name.

| Parameter         | Required | Type                           | Default | Description                                                                                                                                                           |
| ----------------- | :------: | ------------------------------ | :------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| targetDescription |     Y    | `ITargetDescription`           |         | The [Target](/configuration/target) associated with this channel.                                                                                                     |
| customFields      |          | `Set<ICustomFieldDescription>` |         | Set of [Custom Fields](/configuration/custom-field) which belong to the channel.                                                                                      |
| accumulate        |          | `boolean`                      | false   | If enabled, the messages will accumulate all of their tuples (from all the message chunks) and only publish them to the transaction manager when the message is sent. |

#### Java example

```java theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
@Bean
public CsvTopicDescription topic1(NamedEntityResolverService namedEntityResolver) {
    return CsvTopicDescription.builder("topic1", "glob:file*.csv")
            .channel(ChannelDescription.builder(namedEntityResolver.getDlcTargetDescription("target1"))
                    .customFields(
                            Set.of(
                                    new CustomFieldDescription(
                                            "Calculator1",
                                            scope -> new ConstantCalculator<>("field1", 1)
                                    ),
                                    new AnonymousCustomFieldDescription(
                                            scope -> new ConstantCalculator<>("field1", scope.get("constant"))
                                    )
                            )
                    )
                    .build())
            .build();
}
```
