定制 colee/yii2-aliyun-mns 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

colee/yii2-aliyun-mns

Composer 安装命令:

composer require colee/yii2-aliyun-mns

包简介

Aliyun MNS library for Yii2 framework

README 文档

README

YII2插件-阿里云消息队列SDK

配置

'mns'=>[
    'class'=>'colee\aliyun\Mns',
    'accessId' => '',
    'accessKey' => '',
    'endpoint' => 'http://.mns.cn-beijing.aliyuncs.com/',
],

使用示例:

// 发送消息到队列
\Yii::$app->mns->sendMessage("QueueName", "content demo");
// 接收队列消息
$messageObject = \Yii::$app->mns->receiveMessage("QueueName");
$data = $messageObject->getMessageBody();
// 删除队列消息
\Yii::$app->mns->->deleteMessage('QueueName', $messageObject);
//publish 消息到主题
\Yii::$app->mns->publishMessage('TopicName', $data);
//订阅主题,在Yii2的 controller 中接收推送过来的数据
public function actionSubscribe()
{
	$message = \Yii::$app->request->getRawBody();
	$data = json_decode($message, true); //如果消息是JSON,PHP中需要转换成数组

统计信息

  • 总下载量: 86
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-05-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固