PHP Classes

RabbitMQ Manager: Manage exchanges, queues messages in RabbitMQ

Recommend this page to a friend!
  Info   View files Example   View files View files (12)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 122 This week: 1All time: 9,466 This week: 560Up
Version License PHP version Categories
rabbitmqmanager 1.0.0The PHP License5PHP 5, Web services
Description 

Author

This package can manage exchanges, queues, and messages in RabbitMQ.

It can connect to a RabbitMQ server and perform several types of operations with exchanges.

Currently it can retrieve the list of available exchanges, create a new exchange, delete an exchange, publish a message, get queues and queues details.

Innovation Award
PHP Programming Innovation award nominee
September 2017
Number 6
RabbitMQ is a well known message queuing system. Like other similar systems it provides means to store published messages until they are consumed by applications that need to process them.

This package can be used to manage queues stored on a RabbitMQ system by executing the basic operations to create, list, update and delete queues.

Manuel Lemos
Picture of MERAJ AHMAD SIDDIQUI
  Performance   Level  
Name: MERAJ AHMAD SIDDIQUI is available for providing paid consulting. Contact MERAJ AHMAD SIDDIQUI .
Classes: 2 packages by
Country: India India
Age: 29
All time rank: 3652248 in India India
Week rank: 411 Up26 in India India Up
Innovation award
Innovation award
Nominee: 2x

Example

<?php

require dirname(__dir__) . "/vendor/autoload.php";

$configuration_file = dirname(__FILE__)."/config.json";
$configuration = json_decode(file_get_contents($configuration_file), true);

use
RabbitMQManager\Config;
use
RabbitMQManager\Exchange;
/**
 * Set configuration of RabbitMQ connection
 */
Config::init($configuration);

/**
 * This will create an object of exchange to be used for operation on exchange
 */
$exchange = new Exchange();

/**
 * Get List of all exchanges available
 */
$list = $exchange->getExhangeList();
var_dump($list);

/**
 * Create new exchange
 */
$new_exchange_name = "ads";
$new_exchange_args = [
   
"type" => "direct", //Compulsary
   
"auto_delete" => false,
   
"durable" => true,
   
"internal" => false,
   
"arguments" => [
       
"author" => "meraj",
       
"source" => "lib",
    ],
];

$result = $exchange->createExchange($new_exchange_name, $new_exchange_args);
var_dump($result);

/**
 * Publishing Message to an exchange
 */
$publish_exchange_name = "ads";
$publish_data = [
   
"properties" => [

    ],
   
"routing_key" => "ads_test",
   
"payload" => "Thsi is the payload to be published",
   
"payload_encoding" => "string", //string, base64
];

$published = $exchange->publishMessage($publish_exchange_name, $publish_data);
var_dump($published);

/**
 * Deleting any exchange, delete method takes three arguments
 */
//exchange name to delete
$exchange_name = "ads";
//optional ---- default false, If true it will delete it even if its in use
$delete_forcefully = false;
//optional ---- default as provided in configuration
$vhost = "something";

$deleted = $exchange->deleteExchange($exchange_name, $delete_forcefully, $vhost);
var_dump($deleted);


Details

Introduction

RabbitMQ REST API Manager Library is PHP Library based on RabbitMQ GUI REST API. One can use this library to use RabbitMQ and manage it.

Pre Requisites

RabbitMQ Installed. If You have server running RabbitMQ you will just need credential for the service. Else install Rabbit MQ.

If you have access to system running RabbitMQ enable rabbitmq management plugin or ask your server administrator to enable that.

To enable RabbitMQ Management plugin

rabbitmq-plugins enable rabbitmq_management

For more details on configuring RabbitMQ visit RabbitMQ.

Installation

This library is available on Packagist So you can use composer to install. To install from composer .

composer require merajsiddiqui/rabbit-mq-manager

Or you can directly download from github.

Getting Started

If You have downloaded the code from github assuming

Your Pages site will use the layout and styles from the Jekyll theme you have selected in your repository settings. The name of this theme is saved in the Jekyll _config.yml configuration file.

Support or Contact

Having trouble with Library/ Package? Check out our documentation or contact support and we?ll help you sort it out.


  Files folder image Files  
File Role Description
Files folder imageexample (4 files)
Files folder imagesrc (1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file _config.yml Data Auxiliary data

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file config.json Data Auxiliary data
  Accessible without login Plain text file Connecton.php Example Example script
  Accessible without login Plain text file Exchange.php Example Example script
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  src  
File Role Description
Files folder imageRabbitMQManager (5 files)

  Files folder image Files  /  src  /  RabbitMQManager  
File Role Description
  Plain text file Config.php Class Class source
  Plain text file Connection.php Class Class source
  Plain text file Exchange.php Class Class source
  Plain text file Queues.php Class Class source
  Plain text file Request.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:122
This week:1
All time:9,466
This week:560Up