2017 © Pedro Peláez
 

library yii2-aliyun-mns

Aliyun MNS library for Yii2 framework

image

colee/yii2-aliyun-mns

Aliyun MNS library for Yii2 framework

  • Wednesday, June 8, 2016
  • by colee
  • Repository
  • 1 Watchers
  • 4 Stars
  • 74 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

yii2-aliyun-mns

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中需要转换成数组
}

The Versions

08/06 2016

dev-master

9999999-dev https://github.com/colee1985/yii2-aliyun-mns

Aliyun MNS library for Yii2 framework

  Sources   Download

MIT

The Requires

  • php ~5.5|~7.0

 

by Avatar colee

yii2 widget aliyun mns aliyun sdk colee yii2-aliyun-mns

05/05 2016

v1.0.0.0

1.0.0.0 https://github.com/colee1985/yii2-aliyun-mns

Aliyun MNS library for Yii2 framework

  Sources   Download

MIT

The Requires

  • php ~5.5|~7.0

 

by Avatar colee

yii2 widget aliyun mns aliyun sdk colee yii2-aliyun-mns