Skip to content

kafka_sink

sqllocks_spindle.streaming.sinks.kafka_sink

Apache Kafka streaming sink.

Requires the streaming extra::

pip install sqllocks-spindle[streaming]

Classes

KafkaSink

Bases: StreamWriter

Send events to an Apache Kafka topic.

Requires kafka-python::

pip install sqllocks-spindle[streaming]

Parameters:

Name Type Description Default
bootstrap_servers str | list[str]

Kafka broker address(es), e.g. "localhost:9092" or a list ["broker1:9092", "broker2:9092"].

required
topic str

Target Kafka topic name.

required
key_column str | None

Optional column to use as the Kafka message key (ensures ordered delivery per entity within a partition).

None