Skip to content

artox-lab/rabbitmq-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rabbit MQ Wrapper

Installation via Composer

{
    "require": {
        "artox-lab/rabbitmq-wrapper": "1.0.0"
    }
}

Run composer update

Config Usage

<?php

include 'vendor/autoload.php';

// Initial class
$rabbitMQ = $rabbitMQ = new \RabbitMQWrapper\RabbitMQ();

// Creating new queue
$rabbitMQ->createQueue($queueTitle);

// Publishing message to queue
$rabbitMQ->publishMessage($message, $queueTitle);

// Getting last message from queue
$rabbitMQ->getMessage($queueTitle);

// Listening messages from queue (daemon mode)
$rabbitMQ->startListening($queueTitle, $callback);