zt / rabbit-mq
There is no license information available for the latest version (v1.0.1) of this package.
implement RabbitMQ delay queues
v1.0.1
2018-09-15 17:39 UTC
Requires
- php-amqplib/php-amqplib: >=2.6.1
This package is not auto-updated.
Last update: 2025-01-13 22:01:36 UTC
README
This library is a easy-to-use delayed message queue for rabbitMq.
Requirements
- PHP 5.3** due to the use of `namespace`
- php-amqplib/php-amqplib >=2.6.1
Composer
composer install zt/rabbit-mq
Example
- producer
$rabbitMq = new \RabbitMQ\RabbitMQ(); //Send a normal message. $rabbitMq->producer('test', 'Hello world!'); //Send a message delayed by 1 second. $rabbitMq->producer('test', [1, 2] , 1000); //Send a message delayed by 2 second $rabbitMq->producer('test', new stdClass(), 2000);`
- consumer
$rabbitMq = new \RabbitMQ\RabbitMQ(); $rabbitMq->consumer('test' , function($msg){ var_dump($msg); });