thinkphp5中腾讯CMQ的使用分享 (一)

浏览:797 发布日期:2018/12/05 分类:技术分享 关键字: 腾讯CMQ
QCloud CMQ SDK 详细介绍
qcloud-cmq

这个 SDK 是用在腾讯云,CMQ 消息服务上的。支持同步、异步模式。
安装

最好通过 composer 进行安装

运行

php composer.phar require --prefer-dist xutl/qcloud-cmq

或添加

"xutl/qcloud-cmq": "~1.0"

到 composer.json 文件的所需部分。
使用

use XuTL\QCloud\Cmq\Client;

$client = new Client('https://cmq-queue-bj.api.qcloud.com','abcdedgasdf','abcdedgasdf');
$request = new \XuTL\QCloud\Cmq\Requests\ListTopicRequest();
try {
$response = $client->listTopic($request);
print_r($response);
} catch (Exception $e) {
print_r($e->getMessage());
}
thinkphp5中腾讯CMQ的使用分享 (二) 配置
http://www.cesske.com/?p=131
最佳答案
评论( 相关
后面还有条评论,点击查看>>