yii-queue amqp adapter based on amqp-lib package

dev-master / 3.0.x-dev 2023-06-02 07:07 UTC



Yii Queue AMQP Adapter

AMQP adapter based on php-amqplib package for Yii Queue.

Latest Stable Version Total Downloads Build status Scrutinizer Code Quality Code Coverage static analysis Mutation testing badge type-coverage


The preferred way to install this extension is through composer.

Either run

composer require yiisoft/yii-queue-amqp

or add

"yiisoft/yii-queue-amqp": "dev-master"

to the require section of your composer.json file.



Don't forget you have to have the latest version of docker installed and running on your computer in order to use it.

Developer environment

This project has ready to use docker environment inside the tests directory.
It uses docker-compose.yml by default, which is meant to work fine inside CI steps.

To comfortably use docker environment to run tests on your own machine you should extend the default docker-compose.yml with the additional config file docker-compose.development.yml. The simplest way is to copy .env.example file with name .env. It has essential environment variables to use both these yml configurations. Review these variables and change if needed.

Then you can use docker compose as always. To execute unit tests, run the command docker compose run --rm php82 vendor/bin/phpunit inside the tests folder. You can also choose the needed version of php instead of 8.2.

xDebug and PhpStorm

For xDebug to work properly with PhpStorm, you have to additionally configure your PhpStorm. Open Settings and add a new Server in the PHP settings block:

  • Set server name to yii-queue-amqp.
  • Enable path mappings.
  • Set your project root equal to the path /app on the server.

These settings are properly set on the screenshot below: img.png

Unit testing

The package is tested with PHPUnit. To run tests:

cd tests && docker compose build && docker compose run --rm php82 vendor/bin/phpunit

You can use any of the supported PHP versions with service names php80, php81 and php82.
To debug code with xDebug and to use volumes inside the built containers, you can use test/docker-compose.development.yml. To do so you should either run docker compose -f docker-compose.yml -f docker-compose.development.yml run --rm php<version> vendor/bin/phpunit or copy tests/.env.example into tests/.env and run tests as usual.

Also, if you are using Docker, then you have access to a set of prepared commands in the Makefile

Static analysis

# {{ v }} = 80, 81, 82
make static-analyze v=80

Unit tests

# {{ v }} = 80, 81, 82
make test v=80

Mutation tests

# {{ v }} = 80, 81, 82
make mutation-test v=80

Code coverage

# {{ v }} = 80, 81, 82
make coverage v=80

Static analysis

The code is statically analyzed with Psalm. To run static analysis:


Support the project

Open Collective

Follow updates

Official website Twitter Telegram Facebook Slack


The Yii Queue AMQP Adapter is free software. It is released under the terms of the BSD License. Please see LICENSE for more information.

Maintained by Yii Software.