Skip to content

yjtec/amqp_link

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Laravel 消息队列

安装

composer require yjtec/amqp_link

php artisan vendor:publis --provider="Yjtec\AmqpLink\ProduceTopicServiceProvider"

使用

生产者

 app('produce')->produceExchanges('key', 'content');

消费者

$callback = function ($msg) {
    echo $msg->body;
};

app('consume')->consumeQueueTopic($callback, 'key', 'queue_name');