同步操作将从 freyo/laravel-queue-cmq 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Tencent Cloud Message Queue driver for Laravel Queue
腾讯云 CMQ 消息队列
composer require freyo/laravel-queue-cmq
Laravel 5.5+ uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.
config/app.php
:'providers' => [
// ...
Freyo\LaravelQueueCMQ\LaravelQueueCMQServiceProvider::class,
]
.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
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
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
//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');
The MIT License (MIT). Please see License File for more information.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。