新鲜出炉的 aliyun-mqs-lib 来拉
现在公司再使用 redis 作为单独的队列服务,看到阿里云支持队列服务却没有一个好用的 sdk,这里就献丑啦。
安装#
使用 composer 安装
"baocaixiong/aliyun-mqs-lib": "dev-master"
使用#
暂时只针对 laravel4.2
版本,其他环境请自看 phpunit 测试。
- 在 app/config/queue.php 中添加:
'mqs' => [
'driver' => 'mqs',
'queue' => '<queue name>',
'host' => '<queue host>',
'key' => '<access key>',
'secret' => '<access secret>',
'keepalive' => 'receive message waitseconds',
]
将其中 default
键值改为 mqs
-
添加 provider, 在
app/config/app.php
中,providers
键中添加'Mqs\Laravel\MqsServiceProvider'
大家可以一起来完善一下,如果有 bug 欢迎提交 pull request.
还有关于代码设计的问题,大家可以使劲的批评我 。
如果你没有 mqs 的服务的话,可以看我之前的 commit 里面 test/bootstrps.php
里面有。
本帖已被设为精华帖!
推荐文章: