avto-dev/rabbitmq-api-client
RabbitMQ API Client
This package adds into your PHP application RabbitMQ API client implementation.
Install
Require this package with composer using the following command:
$ composer require avto-dev/rabbitmq-api-client "^2.0"
Installed
composeris required (how to install composer).
You need to fix the major version of package.
After that you can "publish" package configuration file using following command:
$ php artisan vendor:publish --provider="AvtoDev\\RabbitMqApiClient\\Frameworks\\Illuminate\\LaravelServiceProvider"
Usage
At first, you should create API client instance:
<?php
use AvtoDev\RabbitMqApiClient\Client;
use AvtoDev\RabbitMqApiClient\ConnectionSettings;
$client = new Client(new ConnectionSettings('http://127.0.0.1:15672', 'guest', 'guest'));
// And after that you can execute API commands, for example:
$client::version(); // Client version, like `1.0.0`
$client->healthcheck(); // `true` or `false`
$client->queueInfo('some-queue-name'); // Object with information about queue
If you are using Laravel framework with registered package service-provider, you can resolve client instance using DI, for example:
<?php
namespace App\Console\Commands;
use AvtoDev\RabbitMqApiClient\ClientInterface;
class SomeCommand extends \Illuminate\Console\Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'some:command';
/**
* Execute the console command.
*
* @param ClientInterface $client
*
* @return void
*/
public function handle(ClientInterface $client): void
{
$client->healthcheck(); // `true` or `false`
}
}
Testing
For package testing we use phpunit framework and docker with compose plugin as develop environment. So, just write into your terminal after repository cloning:
$ make build
$ make latest # or 'make lowest'
$ make test
Changes log
Changes log can be found here.
Support
If you will find any package errors, please, make an issue in current repository.
License
This is open-sourced software licensed under the MIT License.
Related Packages
RabbitMQ and PHP client for Laravel that allows you to add and listen queues mes...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v2.10.0 | ^8.2 | ~11.0 || | MIT | |
| v2.9.0 | ^8.2 | ~10.0 || | MIT | |
| v2.8.0 | ^8.2 | ~10.0 || | MIT | |
| v2.7.0 | ^8.1 | ~10.0 || | MIT | |
| v2.6.0 | ^7.3 || | ~6.0 || | MIT | |
| v2.5.0 | ^7.3 || | ~6.0 || | MIT | |
| v2.4.0 | ^7.2 || | ~6.0 || | MIT | |
| v2.3.0 | ^7.2 | ~6.0 || | MIT | |
| v2.2.0 | ^7.2 | ^5.5 || | MIT | |
| v2.1.0 | ^7.1.3 | >=5.5.0 <5.9.0 || | MIT | |
| v2.0.0 | ^7.1.3 | >=5.5.0 <5.9.0 | MIT | |
| v1.0.1 | >=7.0 | >=5.4.0 <5.8.0 | MIT | |
| v1.0.0 | >=7.0 | >=5.4.0 <5.8.0 | MIT |