jafaripur / php-microservice
Microservice server and client.
dev-master
2022-08-18 11:25 UTC
Requires
- php: ^8.1
- enqueue/amqp-bunny: ^0.10.9
- enqueue/amqp-ext: ^0.10.9
- psr/container: ^1.0 || ^2.0
- psr/log: ^1.1 || ^2.0 || ^3.0
- yiisoft/injector: ^1.0
- yiisoft/json: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- overtrue/phplint: ^4.0
- phpunit/phpunit: ^9.4
- vimeo/psalm: ^4.18
Suggests
- ext-amqp: Using native AMQP wrapper.
- ext-msgpack: Using for msgpack for payload serialize and unserialize.
- jafaripur/php-microservice-application: Sample microservice application template using this library with Spiral framework
- jafaripur/php-microservice-application-symfony: Sample microservice application template using this library with Symfony framework
- jafaripur/php-microservice-application-yii2: Sample microservice application template using this library with Yii2 framework
- jafaripur/php-microservice-application-yii3: Sample microservice application template using this library with Yii3 framework
This package is auto-updated.
Last update: 2024-11-18 16:07:03 UTC
README
Standalone package to implement messaging between microservices nodes in PHP with both server and client. Server consumers listen to receive message and process, client pushing data to message queue to server consumers grab and process.
Features
- Use PHP AMQP extension and change to Bunny library if
ext-amqp
not installed. - PSR-3 compatible logging system.
- PSR-11 compatible service container for dependecy injection on processor file.
- Define processor class for responding to client calling methods.
- Define consumer class and attach processors for it for starting consuming.
- Async command sending.
- Each microservice could be a server or client and can talk to each other.
- Client for sending messages to queue.
Installation
The preferred way to install this package is through composer:
composer require jafaripur/php-microservice
Documentation
For more details, see full document http://php-microservice.readthedocs.io/.
Test
# Run test docker-compose up --build --exit-code-from micro micro # Stop and remove created containers docker-compose down