开源中国 2018 年度最后一场技术盛会邀你来约~错过就要等明年啦!点此立即预约

freyo / laravel-queue-cmqPHPMIT

指数
0
Watch 6 Star 4 Fork 2
加入码云
与超过 300 万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
Tencent Cloud Message Queue driver for Laravel Queue 展开 收起

https://cloud.tencent.com/product/cmq

freyo 最后提交于 minor bug fixes
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README.md

CMQ Queue driver for Laravel

Software License Packagist Version Total Downloads

image

Tencent Cloud Message Queue driver for Laravel Queue

腾讯云 CMQ 消息队列

Installation

composer require freyo/laravel-queue-cmq

Configure

Laravel 5.5+ uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

  1. config/app.php:
'providers' => [
  // ...
  Freyo\LaravelQueueCMQ\LaravelQueueCMQServiceProvider::class,
]
  1. .env:
QUEUE_DRIVER=cmq

CMQ_SECRET_KEY=
CMQ_SECRET_ID=

CMQ_QUEUE_HOST=https://cmq-queue-region.api.qcloud.com
CMQ_QUEUE=queue_name
CMQ_QUEUE_POLLING_WAIT_SECONDS=30

CMQ_TOPIC_ENABLE=false # set to true to use topic
CMQ_TOPIC_FILTER=routing # or msgtag
CMQ_TOPIC_HOST=https://cmq-topic-region.api.qcloud.com
CMQ_TOPIC=topic_name

Tips

  • Region should be replaced with a specific region: gz (Guangzhou), sh (Shanghai), or bj (Beijing).

  • Domain for public network API request: cmq-queue-region.api.qcloud.com / cmq-topic-region.api.qcloud.com

  • Domain for private network API request: cmq-queue-region.api.tencentyun.com / cmq-topic-region.api.tencentyun.com

Usage

Once you completed the configuration you can use Laravel Queue API. If you used other queue drivers you do not need to change anything else. If you do not know how to use Queue API, please refer to the official Laravel documentation: http://laravel.com/docs/queues

Example

//use queue only
Job::dispatch()->onQueue('queue-name');

//use topic and tag filter
Job::dispatch()->onQueue('tag1,tag2,tag3');

//use topic and routing filter
Job::dispatch()->onQueue('routing-key');

Document

License

The MIT License (MIT). Please see License File for more information.

项目点评 ( 0 )

你可以在登录后,发表评论

搜索帮助