KafkaProducerFactory¶
- class lsst.ts.salkafka.KafkaProducerFactory(config, log)¶
Bases:
object
Factory for making Kafka producers.
- Parameters:
- config
KafkaConfiguration
Kafka arguments.
- log
logging.Logger
Logger.
- config
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.
- async make_producer(avro_schema)¶
Make and start a Kafka producer for a topic.
- Parameters:
- avro_schema
dict
Avro schema for the topic.
- avro_schema
- Returns:
- producer
aiokafka.AIOKafkaProducer
Kafka message producer.
- producer
- async start()¶
Start the Kafka clients.