ajouve/rabbit-mq-wrapper

rabbitMQWrapper is a wrapper for RabbitMQ

v1.0.8 2016-12-18 22:28 UTC

This package is not auto-updated.

Last update: 2024-12-21 20:30:35 UTC


README

RabbitMQWrapper is a library to simplify RabbitMQ usage

Examples

Send a new message

$client = new \RabbitMQWrapper\Client();
$client->connect();
$client->publish('Message !!', 'exchange_example', 'exchange_example.key');
$client->close();

Receive a message

$client = new \RabbitMQWrapper\Client();
$client->connect();
$client->consume('queue_example', 'exchange_example', 'exchange_example.key', function(\RabbitMQWrapper\Message $message) {
    echo $message->getContent() . "\n";
    $message->ack();
});
$client->close();