phuongna / rabbitmq
Follow guide https://www.rabbitmq.com/ to create a library easy to use. For Laravel!
1.1.9
2022-05-24 04:18 UTC
Requires
- php: >=7.2
- ext-amqp: *
- ext-json: *
- illuminate/support: ^6.0|^7.0|^8.0
- php-amqplib/php-amqplib: ^3.0
Requires (Dev)
- orchestra/testbench: ^4.0|^5.0|^6.0
- phpunit/phpunit: ^8.4|^9.0
README
Installation
Install via composer
composer require phuongna/rabbitmq
Publish package assets
php artisan vendor:publish --provider="phuongna\rabbitmq\ServiceProvider"
Security
If you discover any security related issues, please email instead of using the issue tracker.
How to use
####Server as service
$this->rabbit = app('rabbitmq.queue')->connection('rabbitmq');
RabbitMQQueue::declareRPCServer($this->rabbit, xxx, function ($request) {
$this->rabbit->replyTo($request, dosomething($request));
});
####Client as service
$this->rabbit = app('rabbitmq.queue')->connection('rabbitmq');
$stringInput = json_encode(array);
RabbitMQQueue::declareRPCClient($this->rabbit, xxx, $stringInput);