You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2018/11/12 03:53:03 UTC

[GitHub] vongosling closed pull request #3: Jonnxu patch readme

vongosling closed pull request #3: Jonnxu patch readme
URL: https://github.com/apache/rocketmq-client-cpp/pull/3
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/README.md b/README.md
index c48fdb3..911c152 100644
--- a/README.md
+++ b/README.md
@@ -1,138 +1,149 @@
-## Introduction
-* RocketMQ client for linux/windows cpp is the kernel implementation of aliyun MQ cpp SDK(https://help.aliyun.com/document_detail/29555.html?spm=5176.doc29532.6.593.yidJeD), and had gone through 3 years time-tested in Alibaba Group,and had been used widly by many services, such as IM service, Navigation, advertisement tool, on-line shopping service and so on;
-## Characteristics
-* 1>. disaster recovery ability
-    - Based on nameServer snapshot and network disaster recovery strategy, no real-time impact on publish/subscribe when anyone of broker or nameSrv was broken
-* 2>. low latency
-    - publish latency < 2ms, subscribe latency < 10ms
-* 3>. High publish/subsricbe TPS
-    - For 16 message queues and stand-alone cpp client, publish TPS > 3W, subsricbe TPS > 15W
-* 4>. support all rocketmq features
-    - Such as broadcast/cluster model, concurrency/orderly publish/subscribe, timed/delay msg, consumer status query and so on. 
-* 5>. support across platform
-    - all features are supported on both windows and linux system.
-* 6>. support Authentication on AliYun by ak/sk
-    - Access AliYun Authentication by calling one interface: MQClient::setSessionCredentials
-## User manaual: doc/rocketmq-cpp_manaual_zh.docx
-## How to build
-### Linux platform
-#### 1. Dependency Installation
-* Install libevent 2.0.22 dependency
-    - Download [libevent 2.0.22](https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz)
-    - Build and install libevent
-	   - ./configure
-	   - make
-	   - make install 
-* Install JsonCPP 0.10.6 dependency
-    - Download [jsoncpp 0.10.6](https://github.com/open-source-parsers/jsoncpp/archive/0.10.6.zip)
-    - Build and install jsoncpp
-  	     - cmake .
-  	     - make
-  	     - make install
-* Install boost 1.56.0 dependency
-	 - Download [boost 1.56.0](http://www.boost.org/users/history/version_1_56_0.html)
-	 - Build and install boost
-	   - cd path/to/boost_1_56_0
-	   - config boost:./bootstrap.sh
-	   - build boost:     
-	       - build static boost lib: ./b2 link=static runtime-link=static cxxflags=" -fPIC"
-	       - build dynamic boost lib: ./b2 link=shared runtime-link=shared cxxflags=" -fPIC"
-	   -  install boost: ./b2 install
-	   
-#### 2. Make and Install
-* Default install path:
-    - header files: /usr/local/include
-    - lib: /usr/local/lib
-* Make and install using cmake
-    - cmake . 
-      cmakewill auto find_package, if failes, change BOOST_INCLUDEDIR/LIBEVENT_INCLUDE_DIR/JSONCPP_INCLUDE_DIR in CMakeList.txt, according to its real install path
-    - make
-    - make install
-	
-#### 3. Check verion
-- strings librocketmq.so |grep VERSION
-	
-### Windows platform:
-#### 1. Dependency Installation
-* Install libevent 2.0.22 dependency
-    - dowload libevent 2.0.22
-        - https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
-    - build and install libevent
-        - extract libevent to C:/libevent 
-        - open VirtualStudio command line tools, go to dir: C:/libevent
-        - execute cmd: nmake /f Makefile.nmake
-        - cp libevent.lib, libevent_extras.lib and libevent_core.lib to C:/libevent/lib
-* install JsonCPP 0.10.6 dependency
-    - download jsoncpp 0.10.6
-        - https://github.com/open-source-parsers/jsoncpp/archive/0.10.6.zip
-    - build and install jsoncpp
-        - extract jsoncpp to C:/jsoncpp
-        - download cmake windows tool(https://cmake.org/files/v3.9/cmake-3.9.3-win64-x64.zip) and extract
-        - run cmake-gui.exe, choose your source code dir and build dir, then click generate which will let you choose VirtualStudio version
-        - open project by VirtualStudio, and build jsoncpp, and jsoncpp.lib will be got
-* install boost 1.56.0 dependency
-    - dowload boost 1.56.0
-        - http://www.boost.org/users/history/version_1_56_0.html
-    - build and install boost 1.56.0
-        - according to following discription: http://www.boost.org/doc/libs/1_56_0/more/getting_started/windows.html
-        - following build options are needed to be set when run bjam.exe: msvc architecture=x86 address-model=64 link=static runtime-link=static stage
-        - all lib will be generated except boost_zlib:
-            - download zlib source: http://gnuwin32.sourceforge.net/downlinks/zlib-src-zip.php and extract to directory C:/zlib
-            - run cmd:bjam.exe msvc architecture=x86 address-model=64 link=static runtime-link=static --with-iostreams -s ZLIB_SOURCE=C:\zlib\src\zlib\1.2.3\zlib-1.2.3 stage
-
-#### 2. Make and Install
-* generate project solution by cmake automatically
-    - download cmake windows tool(https://cmake.org/files/v3.9/cmake-3.9.3-win64-x64.zip) and extract
-    - run cmake-gui.exe, choose your source code dir and build dir, then click generate which will let you choose VirtualStudio version
-    - if generate project solution fails, change BOOST_INCLUDEDIR/LIBEVENT_INCLUDE_DIR/JSONCPP_INCLUDE_DIR in CMakeList.txt, according to its real install path
-* open&build&run project by VirtualStudio
-
-### log path:$HOME/logs/rocketmq-cpp
-
-## Description for Important Parameters  
-- -n	: nameserver addr, if not set -n and -i ,no nameSrv will be got
-- -i	: nameserver domain name,  if not set -n and -i ,no nameSrv will be got
-- Notice: oper should only set one option from -n and -i, 
-- -g	: groupName, contains producer groupName and consumer groupName
-- -t	: msg topic
-- -m	: message count(default value:1)
-- -c 	: msg content(default value: only test)
-- -b	: consume model(default value: CLUSTER)
-- -a	: set sync push(default value: async)
-- -r	: setup retry times(default value:5 times)
-- -u	: select active broker to send msg(default value: false)
-- -d	: use AutoDeleteSendcallback by cpp client(defalut value: false)
-- -T	: thread count of send msg or consume msg(defalut value: system cpu core number)
-- -v 	: print more details information
-
-- Example:
-  - sync producer: ./SyncProducer -g producerGroup -t topic -c msgContent -m msgCount -n nameServerAddr
-  - async producer: ./AsyncProducer  -g producerGroup -t topic -c msgContent -m msgCount -n nameServerAddr 
-  - send delay msg: ./SendDelayMsg  -g producerGroup -t topic -c msgContent -n nameServerAddr
-  - sync pushConsumer: ./PushConsumer  -g producerGroup -t topic -c msgContent -m msgCount -n nameServerAddr -s sync
-  - async pushConsumer: ./AsyncPushConsumer  -g producerGroup -t topic -c msgContent -m msgCount -n nameServerAddr
-  - orderly sync pushConsumer:  ./OrderlyPushConsumer -g producerGroup -t topic -c msgContent -m msgCount -n nameServerAddr -s sync
-  - orderly async pushConsumer: ./OrderlyPushConsumer -g producerGroup -t topic -c msgContent -m msgCount -n nameServerAddr
-  - sync pullConsumer:./PullConsumer  -g producerGroup -t topic -c msgContent -m msgCount -n nameServerAddr 
-
-## Best practice
-- producer must invoke following interface:
-  - DefaultMQProducer g_producer("please_rename_unique_group_name");
-  - g_producer.start();
-  - g_producer.send(...);
-  - g_producer.shutdown();
-
-- pullconsumer must invoke following interface:
-  - DefaultMQPullConsumer     g_consumer("please_rename_unique_group_name");
-  - g_consumer.start();
-  - g_consumer.fetchSubscribeMessageQueues(..., ...);
-  - g_consumer.pull(...)
-  - g_consumer.shutdown();
-
-- pushconsumer must invoke following interface:
-  - DefaultMQPushConsumer g_consumer("please_rename_unique_group_name_1");
-  - g_consumer.subscribe("test_topic", "*");
-  - g_consumer.registerMessageListener(listener);
-  - g_consumer.start();
-  - g_consumer.shutdown();
-  
+# RocketMQ-Client-CPP #
+
+RocketMQ-Client-CPP is the C/C++ client of Apache RocketMQ which is a distributed messaging and streaming platform with low latency, high performance and reliability, trillion-level capacity and flexible scalability.
+
+## Features ##
+
+- produce message, include sync and asynce produce message, timed and delay message. 
+
+- consume message, include concurrency and orderly consume message, broadcast and cluster consume model.
+
+- rebalance, include both produce message and consume message with rebalance.
+
+- C and C++ API, include both C style and C++ style apis.
+
+- across platform, all features are supported on both windows and linux system.
+
+- low latency, publish latency < 2ms, subscribe latency < 10ms
+
+- high tps, rocketmq topic with 16 message queues, stand-alone cpp client can reach publish TPS > 3w and subsricbe TPS > 15w.
+
+- reliability, based on nameServer snapshot and network disaster recovery strategy, no real-time impact on publish and subscribe when anyone of broker or nameSrv was broken.
+
+## Dependency ##
+- libevent 2.0.22
+
+- jsoncpp 0.10.6
+
+- boost 1.56.0
+
+## Documentation ##
+doc/rocketmq-cpp_manaual_zh.docx
+
+## Build and Install ##
+
+### Linux platform ###
+
+**note**: *make sure the following compile tools or libraries has been installed before install dependency libraries*
+
+- compile tools:  **gcc-c++**、**cmake**、**automake**、**libtool**
+
+- libraries:   **openssl-devel**、**bzip2-devel**
+
+#### Dependency Installation ####
+
+1. install [libevent 2.0.22](https://github.com/libevent/libevent/archive/release-2.0.22-stable.zip "libevent 2.0.22")
+```shell
+./autogen.sh
+./configure
+make
+make install
+```
+
+1. install [JsonCPP 0.10.6](https://github.com/open-source-parsers/jsoncpp/archive/0.10.6.zip  "jsoncpp 0.10.6")
+```shell
+cmake .
+make
+make install
+```
+
+1. install [boost 1.56.0](http://sourceforge.net/projects/boost/files/boost/1.56.0/boost_1_56_0.tar.gz "boost 1.56.0")
+```shell
+./bootstrap.sh
+./b2 link=shared runtime-link=shared cxxflags=" -fPIC"
+./b2 install
+```
+#### 2. Make and Install ####
+```shell
+cmake .
+make
+make install
+```
+
+### Windows platform ###
+#### Dependency Installation
+1. install [libevent 2.0.22](https://github.com/libevent/libevent/archive/release-2.0.22-stable.zip "libevent 2.0.22")
+extract libevent to C:/libevent
+open Virtual Studio command line tools, go to dir: C:/libevent
+execute cmd: nmake /f Makefile.nmake
+cp libevent.lib, libevent_extras.lib and libevent_core.lib to C:/libevent/lib
+
+1. install [jsoncpp 0.10.6](https://github.com/open-source-parsers/jsoncpp/archive/0.10.6.zip "jsoncpp 0.10.6")
+extract jsoncpp to C:/jsoncpp
+download [cmake windows tool](https://cmake.org/files/v3.9/cmake-3.9.3-win64-x64.zip "cmake windows tool") and extract
+run cmake-gui.exe, choose your source code dir and build dir, then click generate which will let you choose Virtual Studio version
+open project by VirtualStudio, and build jsoncpp, and jsoncpp.lib will be got
+
+1. install [boost 1.56.0](http://sourceforge.net/projects/boost/files/boost/1.56.0/boost_1_56_0.tar.gz "boost 1.56.0")
+according to following discription: http://www.boost.org/doc/libs/1_56_0/more/getting_started/windows.html
+following build options are needed to be set when run bjam.exe: msvc architecture=x86 address-model=64 link=static runtime-link=static stage
+all lib will be generated except boost_zlib:
+download [zlib source](http://gnuwin32.sourceforge.net/downlinks/zlib-src-zip.php "zlib source") and extract to directory C:/zlib
+run cmd:bjam.exe msvc architecture=x86 address-model=64 link=static runtime-link=static --with-iostreams -s ZLIB_SOURCE=C:\zlib\src\zlib\1.2.3\zlib-1.2.3 stage
+
+#### Make and Install
+run cmake-gui.exe, choose your source code dir and build dir, then click generate which will let you choose VirtualStudio version
+if generate project solution fails, change BOOST_INCLUDEDIR/LIBEVENT_INCLUDE_DIR/JSONCPP_INCLUDE_DIR in CMakeList.txt, according to its real install path
+open&build&run project by VirtualStudio
+
+## Quick Start ##
+### tools and commands ###
+
+- sync produce message
+```shell
+./SyncProducer -g group1 -t topic1 -c test message -n 172.168.1.1:9876
+```
+- async produce message
+```shell
+./AsyncProducer -g group1 -t topic -c test message -n 172.168.1.1:9876
+```
+- send delay message
+```shell
+./SendDelayMsg -g group1 -t topic -c test message -n 172.168.1.1:9876
+```
+- sync push consume message
+```shell
+./PushConsumer -g group1 -t topic -c test message -s sync -n 172.168.1.1:9876 
+```
+- async push comsume message
+```shell
+./AsyncPushConsumer -g group1 -t topic -c test message -n 172.168.1.1:9876
+```
+- orderly sync push consume message
+```shell
+./OrderlyPushConsumer -g group1 -t topic -c test message -s sync -n 172.168.1.1:9876
+```
+- orderly async push consume message
+```shell
+./OrderlyPushConsumer -g group1 -t topic -c test message -n 172.168.1.1:9876
+```
+- sync pull consume message
+```shell
+./PullConsumer -g group1 -t topic -c test message -n 172.168.1.1:9876
+```
+### Parameters for tools ###
+```bash
+-n	: nameserver addr, format is ip1:port;ip2:port
+-i	: nameserver domain name, parameter -n and -i must have one.
+-g	: groupName, contains producer groupName and consumer groupName
+-t	: message topic
+-m	: message count(default value:1)
+-c	: message content(default value: only test)
+-b	: consume model(default value: CLUSTER)
+-a	: set sync push(default value: async)
+-r	: setup retry times(default value:5 times)
+-u	: select active broker to send message(default value: false)
+-d	: use AutoDeleteSendcallback by cpp client(defalut value: false)
+-T	: thread count of send msg or consume message(defalut value: system cpu core number)
+-v	: print more details information
+```


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services