ajouve / rabbit-mq-wrapper
rabbitMQWrapper is a wrapper for RabbitMQ
v1.0.8
2016-12-18 22:28 UTC
Requires
- php: >=5.5.0
- php-amqplib/php-amqplib: 2.6.*
Requires (Dev)
- phpunit/phpunit: ~4.0
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();