kain / rabbitmq-management-api
This package is abandoned and no longer maintained.
No replacement package was suggested.
RabbitMQ Management HTTP API
1.1
2020-04-26 08:44 UTC
Requires
- php: >=7.4
- ext-json: *
- guzzlehttp/guzzle: ^6.0
- php-di/php-di: ^6.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.0
- phpunit/php-code-coverage: ^7.0
- phpunit/phpunit: ^8
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2024-10-05 22:40:55 UTC
README
RabbitMQ Management HTTP API
Setup
composer require kain/rabbitmq-management-api
Usage
Create an RabbitMQ Management HTTP API client
use RabbitMQ\API\RabbitMQ; use GuzzleHttp\Client; $api = RabbitMQ::create( 'http://localhost:15672/api/', 'guest', 'guest' ); // Can also be like this $client = new Client([ 'base_uri' => 'https://myrabbitproxy.com/api/', 'auth' => ['guest', 'guest'], 'timeout' => 30.0, 'debug' => true, 'verify' => false, 'version' => 2.0 ]); $this->api = new RabbitMQ($client);
Get overview
use RabbitMQ\API\RabbitMQ; $api = RabbitMQ::create( 'http://localhost:15672/api/', 'guest', 'guest' ); $response = $api->overview(); // Whether the response failed $response->isError(); // Respond to the prompt message $response->getMsg(); // Response return data $response->getData(); // Returns an array of responses $result = $response->result();
Use method is consistent with the document http://localhost:15672/api/index.html