This library for receive events from RabbitMQ and publish messages to AMQP.
In many application we must use background processes for process any data or create/update/delete any entries. For this, we use AMQP and RabbitMQ. But, in base implementation of AMQP (PHP Extension and PHPAmqpLib) we have some problems:
- We should connect to RabbitMQ before create the exchange or queue. But in our logic (in controller as an example) we don't need to send message rabbitmq.
- All options for declare exchanges or queues set as flags, and it can be difficult for understanding and typos.
We full isolate this processes in this library for easy send message to exchange and easy receive the messages from queues.
All entries of AMQP have a custom definition. Each definition have custom parameters for declare the exchange or queue.
All entries of AMQP have a factory. It allow to create the real instances only on usage process.
We create a library with able to support any adapters for connect to broker. Out-of-the-box supported drivers are:
ext-amqp- composer php-amqplib
All documentation stored in /docs/ directory.
For easy development you can use the Docker.
docker compose up
docker compose exec amqp bashAfter success run and attach to container you must install vendors:
composer updateBefore create the PR or merge into develop, please run next commands for validate code:
./bin/phpunit
./bin/phpcs --config-set show_warnings 0
./bin/phpcs --standard=vendor/escapestudios/symfony2-coding-standard/Symfony/ src/
./bin/phpcs --standard=tests/phpcs-ruleset.xml tests/