Skip to content

myziyue/aliyun-mq-client-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aliyunmq-client-php


[中文文档] | [English]

A Php Client for Aliyun RocketMQ.

Note: because Aliyun's CPP SDK does not support the Coroutine, this extension is temporarily unavailable under the Coroutine framework.

dependence

 In php7.1 environment, php-cpp 2.2.0 is recommended.

INSTALL

  1. Install aliyun-mq-linux-cpp-sdk
# wget "https://ons-client-sdk.oss-cn-hangzhou.aliyuncs.com/linux_all_in_one/2.1.0/rhel7u2/aliyun-mq-linux-cpp-sdk.tar.gz?spm=a2c4g.11186623.2.18.22323a04UlcEJo&file=aliyun-mq-linux-cpp-sdk.tar.gz" -O aliyun-mq-linux-cpp-sdk.tar.gz
# tar zxvf aliyun-mq-linux-cpp-sdk.tar.gz
# cd aliyun-mq-linux-cpp-sdk/
# cp -rf include/* /usr/include/
# cp -rf lib/* /lib64/
  1. Install PHP-CPP
# git clone https://github.com/CopernicaMarketingSoftware/PHP-CPP.git
# cd PHP-CPP
# make && make install
  1. Install aliyunmq-client-php
# sh build.sh
  1. update php.ini file, add line extension=aliyunmq.so;
# echo "extension=aliyunmq.so" >> $PHP_INSTALL_PATH/etc/php.ini
# echo 'aliyunmq.log_path="/tmp/"' >> $PHP_INSTALL_PATH/etc/php.ini

Usage

to see autocompelete file.

Example

to see example file.

todo

  • 普通消息发送
  • 顺序消息发送
  • 定时消息发送
  • 事物消息发送
  • 消息接收