tsterker/rabbitmq-management-api

An object oriented wrapper for the RabbitMQ Management HTTP Api

2.3.0 2021-01-28 21:29 UTC

This package is auto-updated.

Last update: 2024-03-29 04:45:33 UTC


README

A simple object oriented wrapper for the RabbitMQ Management HTTP Api in PHP 5.5.

Forked from 'richardfullmer/php-rabbitmq-management-api' in order to modernize the code and add tests.

Uses Guzzle for REST requests.

Installation

Installable through composer via:

$ composer require tsterker/rabbitmq-management-api

Basic Usage

<?php

use TSterker\RabbitMq\ManagementApi\Client;

require_once __DIR__ . '/../vendor/autoload.php';

$client = new Client();
$queue = $client->queues()->get('/', 'sample-messages-queue');
$response = $client->exchanges()->publish('/', 'sample-messages', array(
    'properties' => array(),
    'routing_key' => '',
    'payload' => 'This is a test',
    'payload_encoding' => 'string'
));

if ($response['routed']) {
    print 'Message delivered';
}

License

php-rabbitmq-management-api is licensed under the MIT License - see the LICENSE file for details

Credits

Structure from KnpLabs php-github-api Rabbit's Excellent Message Queue