tiger/cmq

1.0 2017-01-09 07:44 UTC

This package is not auto-updated.

Last update: 2024-09-23 07:08:54 UTC


README

腾讯云CMQ消息服务

基于 Laravel 封装腾讯云消息服务 API,非 Laravel 也可以使用,但尚未进行测试

示例

  • Laravel

在 config/app.php 的 providers 中注册 Provider,加入以下代码

Tiger\CMQ\CMQServiceProvider::class,

生成配置文件

运行 artisan 命令:vendor:publish --provider=Tiger\\CMQ\\CMQServiceProvider --tag=config

修改 config/cmq.php,将对应的值替换

代码示例


$options = [
    'debug' => true,
    'timeout' => 5,
];

// 创建 queue
$attr = new CMQAttr\CreateQueueAttr();
$attr->Action = 'CreateQueue';
$attr->queueName = 'world-hello';

$response = app('cmq')->createQueue($attr, $options, 'post');

dd($response->isOk(), $response->getBody());