当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 2

lisgroup / laravel-queue-cmq
暂停

forked from freyo / laravel-queue-cmq
暂停
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

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.

MIT License Copyright (c) 2017 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Tencent Cloud Message Queue driver for Laravel Queue 展开 收起
PHP
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
PHP
1
https://gitee.com/lisgroup/laravel-queue-cmq.git
git@gitee.com:lisgroup/laravel-queue-cmq.git
lisgroup
laravel-queue-cmq
laravel-queue-cmq
master

搜索帮助