Skip to content

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 14 Oct 14:58
· 6 commits to main since this release
e83c42f

🚀 Added

  • create_producer(bootstrap_servers, config=None): a started AIOKafkaProducer with the library's serializers, the create_func of the registry behind a producer factory.
  • dsn.KafkaDsn: a settings field for the bootstrap servers, kafka://host[:port][,host[:port]], validated as a URL like pydantic's PostgresDsn; bootstrap_servers gives the ['host:port', ...] list the aiokafka clients take, a missing port is 9092.

🔄 Changed

  • The producer no longer owns its AIOKafkaProducer. BaseKafkaProducer.producer_factory, a ConnectionManagerFactory from ddutils called with alias, hands the producer out for every send, the way a ddsql adapter runs a query inside factory(alias=...). The factory owns the producer's scope (a ScopedRegistry of create_producer per alias, one producer per process and event loop), its lazy start and its stop on shutdown through close().

⚠️ Breaking changes

  • BaseKafkaProducerRepository → BaseKafkaProducer, BaseKafkaConsumerRepository → BaseKafkaConsumer, KafkaConsumerRepositoryMaker → KafkaConsumerMaker (its consumer_repo attribute is consumer). They are owned by a context repository, not repositories themselves.
  • BaseKafkaProducer: the bootstrap_servers and config class attributes, the per-class lock and stop() are replaced by producer_factory (+ optional alias); stop the producers with producer_factory.close() on shutdown.
  • Requires ddutils 0.3.1 and pydantic 2.10.

Full Changelog: v0.0.2...v0.1.0