This is an automated email from the ASF dual-hosted git repository. dinglei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/rocketmq-ons-cpp.git
commit 957fd72ef52226a8c5fdf474697dc7cc22fc93bf Author: ShannonDing <[email protected]> AuthorDate: Fri Jul 26 18:21:35 2019 +0800 Add demo usage --- README.md | 2 +- doc/Introduction.md | 6 +++--- doc/QuickStart.md | 32 +++++++++++++++++++++++++++++--- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c0a5beb..b83d9dd 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A full-fledged ONS C/C++ SDK out of its Java Counterpart taking advantage of Gra ---------- ## Quick Start -* Using binary directly in [Release Version](https://github.com/ShannonDing/rocketmq-ons-cpp/releases) +* Using [quick start](https://github.com/ShannonDing/rocketmq-ons-cpp/blob/master/doc/QuickStart.md) binary directly in [Release Version](https://github.com/ShannonDing/rocketmq-ons-cpp/releases) * Step-by-step instruction are provided in [RocketMQ ONS CPP Introduction](https://github.com/ShannonDing/rocketmq-ons-cpp/blob/master/doc/Introduction.md). * Consult [RocketMQ Quick Start](https://rocketmq.apache.org/docs/quick-start/) to setup rocketmq broker and nameserver. diff --git a/doc/Introduction.md b/doc/Introduction.md index aaace30..e0c0335 100644 --- a/doc/Introduction.md +++ b/doc/Introduction.md @@ -1,7 +1,7 @@ # rocketmq-ons-cpp A full-fledged ONS C/C++ SDK out of its Java Counterpart taking advantage of GraalVM technology. -You can [quick start](https://github.com/ShannonDing/rocketmq-ons-cpp/blob/master/doc/QuickStart.md) by release binary, and also you can build it step by step as below. +You can [quick start demos](https://github.com/ShannonDing/rocketmq-ons-cpp/blob/master/doc/QuickStart.md) by release binary, and also you can build it step by step as below. ---------- ## Prerequisites @@ -32,8 +32,8 @@ Take `/root/tools` as the install path, you can install the build tools by below export PATH ``` -2. Apache Maven: Download the binary[3.6.1](http://maven.apache.org/download.cgi) to the install path and unpack it, enable it by set runtime path to ``.bash_profile``. -3. cmake: Download the binary[3.14](https://cmake.org/download/) to the install path and unpack it, enable it by set runtime path to ``.bash_profile``. +2. Apache Maven: Download the binary [3.6.1](http://maven.apache.org/download.cgi) to the install path and unpack it, enable it by set runtime path to ``.bash_profile``. +3. cmake: Download the binary [3.14](https://cmake.org/download/) to the install path and unpack it, enable it by set runtime path to ``.bash_profile``. 4. g++: for centos7, the default gcc version is 4.8, you can install it by yum ```bash yum install gcc gcc-c++ diff --git a/doc/QuickStart.md b/doc/QuickStart.md index 82951a9..ea8c719 100644 --- a/doc/QuickStart.md +++ b/doc/QuickStart.md @@ -1,4 +1,30 @@ -#Quick start by binary library -This page tell us how to using binary library to send and consume messages. +#RocketMQ ONS CPP 使用说明中文版 +------------- +#### 1. 版本包介绍 ----------------------------------------------------------- +下载完成后选择对应操作系统内核的版本进行解压,会有如下目录结构: +``` +demos/ +include/ +lib/ +changelog +``` +上面的目录和文件的作用如下: +1. demos:包含了普通消息发送、Oneway 消息发送、顺序消息发送、普通消息消费、顺序消息消费等例子,还包含了 CMakeList.txt 用于 demo 的编译和管理。 +2. include:用户自己编写的程序需要 include 的头文件。 +3. lib:包含基于x86_64的动态库,分别为接口库和内核库。 + libonsclient4cpp.so + librocketmq_client_core.so +4. changelog: 新版本发布解决的问题和引入的新特性列表。 + +#### 2. Demos的使用 +此版本的SDK只提供动态库方案。消息队列 RocketMQ 的库文件在 lib/目录下,生成可执行文件时需要链接 librocketmq_client_core.so和 libonsclient4cpp.so。由于demo引入了C++11的特性和使用cmake来管理,需要提前安装cmake3.0以上版本和g++ 4.8及以上版本。 + +*注意*:由于 GCC 5.x 引入 [Dual ABI](https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html),编译链接时,请添加 -D_GLIBCXX_USE_CXX11_ABI=0 编译选项。 +``` +cd aliyun-mq-linux-cpp-sdk //下载的 SDK 解压后的路径 +cd demos //进入 demos 目录,修改 demo 文件,填入自己在消息队列 RocketMQ 控制台创建的 Topic,key 相关的信息 +cmake . //检测依赖和生成编译脚本 +make 执行编译操作 +cd bin //到生成的可执行文件目录下运` +``` \ No newline at end of file
