taskiq-aio-pika is a broker implementation for the Taskiq asynchronous task queue, enabling it to use RabbitMQ as a message broker. It leverages aio-pika for asynchronous AMQP communication, providing robust and scalable message passing. The current version is 0.6.0 and it typically follows the release cadence of the main Taskiq library.
pip install taskiq-aio-pikaVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to configure `taskiq-aio-pika` by defining a `TaskiqSettings` class with an `AioPikaBroker` instance pointing to your RabbitMQ server. A simple task `process_data` is then defined using the broker's decorator. To run the worker, execute `taskiq worker your_module_name:settings_instance` in your terminal.
Ensure RabbitMQ is running. Verify the `url` parameter passed to `AioPikaBroker` (e.g., `amqp://guest:guest@localhost:5672/`). Check firewall rules or Docker network configurations.
Always check the release notes for both `taskiq` and `taskiq-aio-pika` when upgrading. Upgrade both libraries concurrently to compatible versions, as specified in `taskiq-aio-pika`'s `pyproject.toml` or `requirements.txt`.
Use a virtual environment to manage dependencies. Ensure all packages requiring Pydantic are compatible with Pydantic v2. If a legacy dependency requires Pydantic v1, consider isolating environments or finding alternatives.
Start your RabbitMQ server. Verify the RabbitMQ host and port in your `AioPikaBroker` URL (e.g., `localhost:5672`). Check network connectivity and firewall settings.
Ensure the package is installed: `pip install taskiq-aio-pika`. Double-check the spelling of `AioPikaBroker` and `taskiq_aio_pika`.
Examine the application logs for earlier `aio-pika` connection errors (e.g., `Connection refused`, `Authentication failed`). Verify RabbitMQ server status, credentials, and network reachability. This error often surfaces after underlying connection issues.