Releases: taskiq-python/taskiq-aio-pika
0.6.0rc0
Description
Taskiq-aio-pika 0.6 is a significant technical release that aimed to address many of the current project design issues and unlock further improvements. We tried our best to minimize breaking changes, but unfortunately, some aspects were simply not working well. Therefore, we decided to break them in order to move forward.
This release includes:
- Multi-queue support;
- Custom settings for queues and exchanges for tasks;
- Support for diffrent types of queues/exchanges;
- A range of minor refactors and improvements.
Breaking changes
Broker parameters
AioPikaBroker now accepts new arguments during initialization. Queues and exchanges are configured using the Queue and Exchange classes and then passed to the broker. The old style of passing only names, routing keys or even unvalidated key arguments is no longer supported.
from taskiq_aio_pika import AioPikaBroker, Queue, QueueType, Exchange
from aio_pika.abc import ExchangeType
broker = AioPikaBroker(
exchange=Exchange(
name="custom_exchange",
type=ExchangeType.TOPIC,
declare=True,
durable=True,
auto_delete=False,
)
task_queues=[
Queue(
name="custom_queue",
type=QueueType.CLASSIC,
declare=True,
durable=True,
max_priority=10,
routing_key="custom_queue",
)
]
)If declare=True is set, the queues and exchange will be declared automatically during broker initialization.
Multi-queue support
You can now define multiple queues for your tasks. Each queue can have its own routing key and settings, and workers can listen either to specific queues or to multiple queues at once.
broker = AioPikaBroker(
exchange=Exchange(
name="custom_exchange",
type=ExchangeType.TOPIC,
declare=True,
durable=True,
auto_delete=False,
)
task_queues=[
Queue(
name="custom_queue",
routing_key="custom_queue",
),
Queue(
name="custom_queue_2",
routing_key="custom_queue_2",
),
]
)Once the broker is configured, you can route a task to a specific queue by adding a label:
await your_cool_task.kicker().with_labels(queue_name='custom_queue').kiq()You can customize the label name used for routing in the broker configuration. Make sure that this label name does not collide with any other labels used in your project.
Full Changelog: 0.5.0...0.6.0rc0
0.5.0
0.4.4
0.4.3
0.4.2
0.4.1
What's Changed
- add py.typed by @dimastbk in #26
- chore: remove unused fallback for python 3.7 by @dimastbk in #27
- Added py.typed directive to avoid mypy warnings by @joshvote in #28
- Allow passing extra params to declare exchange and declare queues (duplicated with linter fixes) by @Steve-Bupyc in #31
- Switch to gitflow and ruff. by @s3rius in #32
New Contributors
- @dimastbk made their first contribution in #26
- @joshvote made their first contribution in #28
- @Steve-Bupyc made their first contribution in #31
Full Changelog: 0.4.0...0.4.1
0.4.0
0.3.0
0.2.2
What's Changed
- Added rabbitmq-delayed-message-exchange plugin support to create delay messages. by @chandr-andr in #15
New Contributors
- @chandr-andr made their first contribution in #15
Full Changelog: 0.2.1...0.2.2