Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
[0.7.0]¶
Added¶
- Type-safe topics:
TypedTopic[T]generic class binding a topic name to serializer/deserializer pairs;json_topic()andstring_topic()factory functions;KafkaProducer.send_typed()andKafkaMessage.decode()methods - Structured logging:
KafkaLoggerwrapper for stdliblogging.Loggerwith Kafka-specific context;LogContextdataclass; automatic logging in producer send, consumer poll/commit, and transaction lifecycle - Cookbook: 7 recipes in
docs/cookbook.md— exactly-once processing, fan-out, graceful shutdown, typed topics, structured logging, consumer lag monitoring, dead letter queue with retry - API documentation for topics and logging modules
- Expanded integration tests from 25 to 70
Changed¶
- Test coverage: 446+ tests
[0.6.0]¶
Added¶
- Enhanced exceptions:
KafkaErrorContextdataclass for structured error metadata; newConfigurationErrorandTransactionErrorexception classes - Configuration presets:
ProducerConfig.high_throughput()andexactly_once()class methods for common setups - Environment config loading:
ProducerConfig.from_env()andConsumerConfig.from_env()for 12-factor app config enable_idempotence()andtransactional_id()methods onProducerConfig- Cross-field configuration validation (e.g. idempotence requires
acks=all) - Generic consumer deserialization:
KafkaMessage.value_as(deserializer)andvalue_deserializerparameter onKafkaConsumer - Async improvements:
AsyncKafkaProducer.send_string(),MessageBatchclass,batch_consume()async generator - Testing enhancements:
fail_on_topicsonMockProducer,message_count(),get_json_messages(),MockConsumer.add_string_message() - Integration test infrastructure:
tests/integration/with Docker Compose and CI workflow for Kafka broker tests - Protobuf serialization:
ProtobufSerializer,ProtobufDeserializer,SchemaRegistryProtobufSerializer, and helper functions intypedkafka.protobuf - OpenTelemetry tracing:
KafkaTracerwithproduce_span()andconsume_span()context managers following OTel semantic conventions; graceful no-op when OTel is not installed protobufandalloptional dependency groups- GitHub Pages docs deployment workflow
Changed¶
- Transaction methods on
KafkaProducernow raiseTransactionErrorinstead ofProducerError build(validate=True)on config builders now raisesConfigurationErrorinstead ofValueError- Test coverage: 418 tests at 96% coverage (up from 320 tests)
[0.5.0]¶
Added¶
- Metrics collection:
KafkaMetricsandKafkaStatsdataclasses for tracking throughput, errors, and byte counters on producers and consumers on_statscallback parameter onKafkaProducerandKafkaConsumerfor receiving parsed statistics from confluent-kafka'sstats_cbstats_interval_ms()method onProducerConfigandConsumerConfigbuildersmetricsproperty onKafkaProducer,KafkaConsumer,MockProducer, andMockConsumer- Dead Letter Queue:
DeadLetterQueueclass for routing failed messages to a DLQ topic with error metadata headers process_with_dlq()helper for try/except message processing with automatic DLQ routingheadersparameter onKafkaProducer.send()andMockProducer.send()for attaching Kafka headers to messagesMockDeadLetterQueueintypedkafka.testingfor unit testing DLQ logic without a broker- New examples:
examples/metrics.py,examples/dead_letter_queue.py - Updated examples: headers in
producer.py, stats/security inconfig_builders.py, metrics and DLQ intesting_mocks.py - Test coverage: 320 tests (up from 294)
[0.4.0]¶
Added¶
- Consumer offset management:
seek(),assignment(),assign(),position()methods onKafkaConsumer poll_batch()method onKafkaConsumerfor consuming multiple messages at once- Security config helpers:
sasl_plain(),sasl_scram(),ssl()on bothProducerConfigandConsumerConfig - Config validation:
build(validate=True)checks for required fields (bootstrap.servers,group.id) MockMessagenow matchesKafkaMessageinterface:value_as_string(),value_as_json(),key_as_string(),__repr__()MockConsumeroffset management:seek(),assignment(),assign(),position(),poll_batch()DeliveryCallbacktype alias for delivery report callbacks in producer and testing modulesKafkaMessageadded to top-level__all__exports
Changed¶
- Async consumer
poll()now returnsKafkaMessageinstead of raw confluent-kafka message - Async consumer
__aiter__yieldsKafkaMessageobjects for API consistency - Async producer and consumer docstrings now document ThreadPoolExecutor wrapping limitation
Fixed¶
- Delivery callback type annotations now compatible with mypy strict checking
[0.3.3]¶
Added¶
- Separate
CHANGELOG.mdfollowing Keep a Changelog format Makefilewith common dev tasks (make test,make lint,make check, etc.)- Shared test fixtures in
tests/conftest.py - Tests for
admin.pyandaio.py(test count: 120 → 146) - Python 3.13 to CI test matrix
- MkDocs documentation site with Material theme and auto-generated API reference
docsoptional dependency group for documentation tooling
Changed¶
- Moved inline changelog from README to
CHANGELOG.md - Updated documentation URL to GitHub Pages
[0.3.2]¶
Changed¶
- Move code examples from README into standalone
examples/directory - Pin all CI/CD actions to commit SHAs for supply chain security
- Switch PyPI publishing to Trusted Publishers (OIDC) instead of API tokens
Added¶
py.typedmarker file for PEP 561 compliance
[0.3.1]¶
Changed¶
- Update README, CONTRIBUTING, and SECURITY docs for v0.3.0 features
[0.3.0]¶
Added¶
- Transaction support:
init_transactions(),begin/commit/abort_transaction(),transaction()context manager - Async producer and consumer (
typedkafka.aio) - Retry utilities:
@retrydecorator andRetryPolicyclass - Pluggable serializers:
Serializer/DeserializerABCs, JSON, String, and Avro implementations - Batch send:
send_batch()on producer - Consumer rebalance callbacks:
on_assign,on_revoke,on_lostonsubscribe() - Configurable iterator poll timeout via
poll_timeoutattribute - Config validation: early
ValueErroron invalidacks,compression,auto_offset_reset,linger_ms,batch_size - Expanded test suite (120 tests)
[0.2.0]¶
Added¶
- Testing utilities (MockProducer, MockConsumer)
- Type-safe configuration builders (ProducerConfig, ConsumerConfig)
- Admin client wrapper for topic management
[0.1.0]¶
Added¶
- Initial release with KafkaProducer, KafkaConsumer, full type hints, context manager support