artox-lab/rabbitmq-wrapper

Wrapper for RabbitMQ

1.0.4 2021-07-27 15:49 UTC

This package is not auto-updated.

Last update: 2024-12-21 01:28:17 UTC


README

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);