|
| 1 | +--- |
| 2 | +title: "Changelog 4.4.0" |
| 3 | +description: "Release notes for ArchiPy 4.4.0" |
| 4 | +--- |
| 5 | + |
| 6 | +# 4.4.0 — 2026-03-13 |
| 7 | + |
| 8 | +[← 4.3.6](4.3.6.md) | [↑ 4.x series](index.md) |
| 9 | + |
| 10 | +## Added |
| 11 | + |
| 12 | +### Adapters - Kafka |
| 13 | + |
| 14 | +- **Async Kafka Producer Adapter** - Introduced `AsyncKafkaProducerAdapter` for non-blocking message production using |
| 15 | + `confluent-kafka`'s thread-based async delivery model. |
| 16 | + - Implements the new `AsyncKafkaProducerPort` interface with `async produce`, `async flush`, and `async close` |
| 17 | + methods |
| 18 | + - Lazy-initialises the underlying `confluent-kafka` `Producer` on first use to avoid blocking the event loop at |
| 19 | + construction time |
| 20 | + - Supports configurable worker threads (`kafka_async_worker_threads`) and buffer flush timeout |
| 21 | + (`kafka_async_buffer_timeout_seconds`) via `KafkaConfig` |
| 22 | +- **Async Kafka Consumer Adapter** - Introduced `AsyncKafkaConsumerAdapter` for non-blocking message consumption. |
| 23 | + - Implements the new `AsyncKafkaConsumerPort` interface with `async consume`, `async subscribe`, `async commit`, |
| 24 | + and `async close` methods |
| 25 | + - Offloads blocking `confluent-kafka` `Consumer` calls to a thread pool executor to keep the event loop free |
| 26 | +- **Async Kafka Ports** - Added `AsyncKafkaProducerPort` and `AsyncKafkaConsumerPort` abstract base classes to |
| 27 | + `archipy/adapters/kafka/ports.py`. |
| 28 | + - Defines the async contract that all async Kafka adapter implementations must satisfy |
| 29 | +- **Close Methods on Sync Adapters** - Added explicit `close()` methods to `KafkaConsumerAdapter` and |
| 30 | + `KafkaProducerAdapter` for deterministic resource cleanup. |
| 31 | + |
| 32 | +### Configs - Kafka |
| 33 | + |
| 34 | +- **Async Kafka Config Fields** - Extended `KafkaConfig` with two new settings for the async adapters. |
| 35 | + - `kafka_async_worker_threads: int` — number of threads in the async executor pool (default `4`) |
| 36 | + - `kafka_async_buffer_timeout_seconds: float` — maximum seconds to wait when flushing the producer buffer on close |
| 37 | + (default `5.0`) |
| 38 | + |
| 39 | +### Tests - Kafka |
| 40 | + |
| 41 | +- **Async BDD Scenarios** - Expanded `features/kafka_adapters.feature` with end-to-end scenarios for |
| 42 | + `AsyncKafkaProducerAdapter` and `AsyncKafkaConsumerAdapter`. |
| 43 | + - Covers produce, consume, subscribe, commit, flush, and close lifecycle |
| 44 | + - Step implementations in `features/steps/kafka_adapter_steps.py` use `await` throughout instead of |
| 45 | + `asyncio.run()` |
| 46 | + |
| 47 | +## Changed |
| 48 | + |
| 49 | +### Tests - BDD |
| 50 | + |
| 51 | +- **Async Step Implementations** - Refactored all async Behave step functions across multiple feature files to use |
| 52 | + `await` instead of `asyncio.run()`. |
| 53 | + - Affected files: `atomic_transaction_steps.py`, `error_utils_steps.py`, `grpc_error_handling_steps.py`, |
| 54 | + `metric_interceptor_steps.py` |
| 55 | + - Eliminates nested event-loop errors when steps run inside an already-running loop |
| 56 | +- **`test_helpers.py` Cleanup** - Removed deprecated utility functions from `features/test_helpers.py` that were |
| 57 | + superseded by the async step refactor. |
| 58 | + |
| 59 | +## Chore |
| 60 | + |
| 61 | +### Docs - Kafka |
| 62 | + |
| 63 | +- **Kafka Tutorial Expansion** - Substantially expanded `docs/tutorials/adapters/kafka.md` to document all five |
| 64 | + adapter classes (`KafkaAdminAdapter`, `KafkaConsumerAdapter`, `KafkaProducerAdapter`, |
| 65 | + `AsyncKafkaConsumerAdapter`, `AsyncKafkaProducerAdapter`). |
| 66 | + - Added dedicated sections for async adapters, lazy initialisation behaviour, and usage in non-async contexts |
| 67 | + - Improved logging examples for consistency with documentation standards |
| 68 | +- **Kafka API Reference Update** - Updated `docs/api_reference/adapters/kafka.md` to list all five adapter classes |
| 69 | + and their async configuration options. |
| 70 | +- **Documentation Admonition Style** - Migrated all admonitions across 19 documentation files from MkDocs `!!!` |
| 71 | + directives to block-quote callouts (`> **Type:** ...`) to prevent formatting issues in PyCharm. |
| 72 | +- **Quickstart Redis Update** - Updated `docs/getting-started/quickstart.md` to reflect the current Redis caching |
| 73 | + implementation. |
| 74 | +- **BDD Testing Rule Update** - Clarified Behave version (1.3.3) and async step conventions in |
| 75 | + `.cursor/rules/testing-bdd.mdc`. |
0 commit comments