PHP code example of artox-lab / rabbitmq-wrapper
1. Go to this page and download the library: Download artox-lab/rabbitmq-wrapper library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
artox-lab / rabbitmq-wrapper example snippets
itial 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);