KafkaProducerFactory

class lsst.ts.salkafka.KafkaProducerFactory(config, log)

Bases: object

Factory for making Kafka producers.

Parameters:
configKafkaConfiguration

Kafka arguments.

loglogging.Logger

Logger.

Methods Summary

close()

Close the Kafka clients.

make_kafka_topics(topic_names)

Initialize Kafka topics that do not already exist.

make_producer(avro_schema)

Make and start a Kafka producer for a topic.

start()

Start the Kafka clients.

Methods Documentation

async close()

Close the Kafka clients.

make_kafka_topics(topic_names)

Initialize Kafka topics that do not already exist.

Parameters:
topic_nameslist`[ `str ]

List of Kafka topic names.

Returns:
new_topic_nameslist [str]

List of newly created Kafka topic names.

async make_producer(avro_schema)

Make and start a Kafka producer for a topic.

Parameters:
avro_schemadict

Avro schema for the topic.

Returns:
produceraiokafka.AIOKafkaProducer

Kafka message producer.

async start()

Start the Kafka clients.