ConnectConfig

class kafkaconnect.config.ConnectConfig(name: str = '', connector_class: str = '', topics: str = '', tasks_max: int = 1)

Bases: object

Generic connector configuration.

Attributes Summary

connector_class Name of the connector class.
name Name of the connector.
tasks_max Number of connect tasks to scale out.
topics Comma separated list of Kafka topics to read from (sink connectors) or to write to (source connectors).

Methods Summary

asjson()
format_field_names(fields, Any]]) Dictionary factory to use with the dataclasses.asdict() method.
update_topics(topics) Update the list of Kafka topics.

Attributes Documentation

connector_class = ''

Name of the connector class.

name = ''

Name of the connector.

The connector name must be unique accross the cluster.

tasks_max = 1

Number of connect tasks to scale out.

Topics and partitions are distributed accross tasks.

topics = ''

Comma separated list of Kafka topics to read from (sink connectors) or to write to (source connectors).

Methods Documentation

asjson() → str
static format_field_names(fields: List[Tuple[str, Any]]) → Dict[str, str]

Dictionary factory to use with the dataclasses.asdict() method.

Rename the field name replacing ‘_’ by ‘.’ and return a dictionary mapping field names to field values.

update_topics(topics: List[str]) → None

Update the list of Kafka topics.

Parameters:topics (list) – List of kafka topics.