2017 © Pedro Peláez
 

library rabbitmq-management

Abstraction for the rabbitmq management

image

innmind/rabbitmq-management

Abstraction for the rabbitmq management

  • Sunday, April 15, 2018
  • by Baptouuuu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 21 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

RabbitMQManagement

Build Status codecov Type Coverage, (*1)

Wrapper for the rabbitmqadmin command., (*2)

Installation

composer require innmind/rabbitmq-management

Usage

use Innmind\RabbitMQ\Management\{
    Status,
    Control,
};
use Innmind\OperatingSystem\Factory;

$os = Factory::build();
$status = Status::of(
    $os->control(),
    $os->clock(),
);
$status->users();
$status->vhosts();
$status->connections();
$status->exchanges();
$status->permissions();
$status->channels();
$status->consumers();
$status->queues();
$status->nodes();

$control = Control::of($server);
$control->users();
$control->vhosts();
$control->permissions();

Essentially this will run rabbitmqadmin list {element} on the server and extract informations., (*3)

If you need to list the information of a remote server, then you can simply do this:, (*4)

use Innmind\RabbitMQ\Management\Status\Environment\Remote;
use Innmind\Url\{
    Authority\Host,
    Authority\Port,
    Path,
};

Status::of(
    $os->control(),
    $os->clock(),
    Remote::of(
        Host::of('your-host'),
        Port::of(1337),
        'username',
        'password',
        Path::of('/some-vhost'),
    ),
);

However for this to work you need to have rabbitmqadmin installed on the machine this code will run., (*5)

In case you don't have the command on the machine, you can replace $os->control() by $os->remote()->ssh(/*...*/) so it will use ssh to run the command on the machine (and you will need to remove the third argument from Status::of())., (*6)

The Versions