Skip to content

Commit 860849e

Browse files
committed
Polish readme
1 parent 141c5bd commit 860849e

File tree

1 file changed

+64
-58
lines changed

1 file changed

+64
-58
lines changed

README.md

Lines changed: 64 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,21 @@
1-
# RocketMQ-Client-CPP #
1+
# RocketMQ-Client-CPP
22

3-
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.
3+
RocketMQ-Client-CPP is the C/C++ client of Apache RocketMQ, a distributed messaging and streaming platform with low latency, high performance and reliability, trillion-level capacity and flexible scalability.
44

5-
## Features ##
5+
## Features
66

7-
- produce message, include sync and async produce message, timed and delay message.
7+
- produce messages, including normal and delayed messages, synchronously or asynchronously.
8+
- consume messages, in cluster or broadcast model, concurrently or orderly
9+
- c and c++ style API.
10+
- cross-platform, all features are supported on Windows, Linux and Mac OS.
11+
- automatically rebalanced, both in producing and consuming process.
12+
- reliability, any downtime broker or name server has no impact on the client.
813

9-
- consume message, include concurrency and orderly consume message, broadcast and cluster consume model.
14+
## Build and Install
1015

11-
- rebalance, include both produce message and consume message with rebalance.
16+
### Linux and Mac OS
1217

13-
- C and C++ API, include both C style and C++ style apis.
14-
15-
- across platform, all features are supported on Windows, Linux and Mac OS.
16-
17-
- reliability, based on nameserver snapshot and network disaster recovery strategy, no real-time impact on publish and subscribe when anyone of broker or nameserver was broken.
18-
19-
## Dependency ##
20-
21-
- [libevent 2.0.22](https://github.com/libevent/libevent/archive/release-2.0.22-stable.zip "libevent 2.0.22")
22-
23-
- [jsoncpp 0.10.6](https://github.com/open-source-parsers/jsoncpp/archive/0.10.6.zip "jsoncpp 0.10.6")
24-
25-
- [boost 1.58.0](http://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.gz "boost 1.58.0")
26-
27-
## Build and Install ##
28-
29-
### Linux and Mac OS ###
30-
31-
**note**: *make sure the following compile tools or libraries with them minimum version number have been installed before run the build script build.sh*
18+
**note**: make sure the following compile tools or libraries have been installed before running the build script **build.sh**.
3219

3320
- compile tools:
3421
- gcc-c++ 4.8.2: c++ compiler while need support C++11
@@ -40,79 +27,96 @@ RocketMQ-Client-CPP is the C/C++ client of Apache RocketMQ which is a distribute
4027
- libraries:
4128
- bzip2-devel 1.0.6: boost depend it
4229

43-
build.sh script will automatic download and build the dependency libraries include libevent json and boost, the libraries will be saved under rocketmq-client-cpp folder, and then it will build both rocketmq-client static and shared libraries.
30+
The **build.sh** script will automatically download and build the dependency libraries including libevent, json and boost. It will save libraries under rocketmq-client-cpp folder, and then build both static and shared libraries for rocketmq-client. If the dependent libraries are built failed, you could try to build it manually with sources [libevent 2.0.22](https://github.com/libevent/libevent/archive/release-2.0.22-stable.zip "lib event 2.0.22"), [jsoncpp 0.10.6](https://github.com/open-source-parsers/jsoncpp/archive/0.10.6.zip "jsoncpp 0.10.6"), [boost 1.58.0](http://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.gz "boost 1.58.0")
4431

45-
if you can't get to internet to download three library source files by build.sh script, you can copy three library source files (release-2.0.22-stable.zip 0.10.6.zip and boost_1_58_0.tar.gz) to rocketmq-client-cpp root dir, then build.sh will auto use these three library source files to build rocketmq-client-cpp.
32+
If your host is not available to internet to download the three library source files, you can copy the three library source files (release-2.0.22-stable.zip 0.10.6.zip and boost_1_58_0.tar.gz) to rocketmq-client-cpp root dir, then the build.sh will automatically use the three library source files to build rocketmq-client-cpp:
4633

4734
sh build.sh
4835

49-
Finally, both librocketmq.a and librocketmq.so are saved in rocketmq-client-cpp/bin. when use them to build application or library, besides rocketmq you also should link with following libraries -lpthread -lz -ldl -lrt.
36+
Finally, both librocketmq.a and librocketmq.so are saved in rocketmq-client-cpp/bin. when using them to build application or library, besides rocketmq you should also link with following libraries -lpthread -lz -ldl -lrt. Here is an example:
5037

5138
g++ -o consumer_example consumer_example.cpp -lrocketmq -lpthread -lz -ldl -lrt
5239

53-
### Windows ###
54-
**note**: *make sure the following compile tools or libraries with them minimum version number have been installed before run the build script win32_build.bat*
40+
### Windows
41+
**note**: make sure the following compile tools or libraries have been installed before running the build script **win32_build.bat**:
42+
5543
- compile tools:
5644
- vs2015: libevent,jsoncpp,zlib,boost rocket-client require it
5745
- git: download source code
5846

59-
one key build script will automatic download dependency libraries include libevent json and boost, execute follow command,then it will build shared library.
47+
The build script will automatically download dependent libraries including libevent json and boost to build shared library:
6048

6149
win32_build.bat
6250

6351

64-
if can't get internet to download four library source files by build script, you can copy four library source files
52+
If your host is not available to internet to download the four library source files by build script, you can copy the four library source files
6553

66-
[zlib-1.2.3-src](https://codeload.github.com/jsj020122/zlib-1.2.3-src/zip/master "zlib-1.2.3-src") Extract to $(rocketmq-client root dir)/thirdparty/zlib-1.2.3-src
54+
[zlib-1.2.3-src](https://codeload.github.com/jsj020122/zlib-1.2.3-src/zip/master "zlib-1.2.3-src") Extract to $(rocketmq-client-cpp root dir)/thirdparty/zlib-1.2.3-src
6755

68-
[libevent-release-2.0.22](https://codeload.github.com/jsj020122/libevent-release-2.0.22/zip/master "libevent-release-2.0.22") Extract to $(rocketmq-client root dir)/thirdparty/libevent-release-2.0.22
56+
[libevent-release-2.0.22](https://codeload.github.com/jsj020122/libevent-release-2.0.22/zip/master "libevent-release-2.0.22") Extract to $(rocketmq-client-cpp root dir)/thirdparty/libevent-release-2.0.22
6957

70-
[boost_1_58_0](https://codeload.github.com/jsj020122/boost_1_58_0/zip/master "boost_1_58_0") Extract to $(rocketmq-client root dir)/thirdparty/boost_1_58_0
58+
[boost_1_58_0](https://codeload.github.com/jsj020122/boost_1_58_0/zip/master "boost_1_58_0") Extract to $(rocketmq-client-cpp root dir)/thirdparty/boost_1_58_0
7159

72-
[jsoncpp-0.10.6](https://codeload.github.com/jsj020122/jsoncpp-0.10.6/zip/master "jsoncpp-0.10.6") Extract to $(rocketmq-client root dir)/thirdparty/jsoncpp-0.10.6
60+
[jsoncpp-0.10.6](https://codeload.github.com/jsj020122/jsoncpp-0.10.6/zip/master "jsoncpp-0.10.6") Extract to $(rocketmq-client-cpp root dir)/thirdparty/jsoncpp-0.10.6
7361

74-
then execute follow command will auto use these library files to build rocketmq-client.
62+
And then run following command to build rocketmq-client:
7563

7664
win32_build.bat build
7765

7866

79-
## Quick Start ##
80-
### tools and commands ###
67+
## Quick Start
68+
### Tools and Commands
69+
70+
- sync produce message
8171

82-
- sync produce message
8372
```shell
8473
./SyncProducer -g group1 -t topic1 -c test message -n 172.168.1.1:9876
85-
```
86-
- async produce message
74+
```
75+
76+
- async produce message
77+
8778
```shell
8879
./AsyncProducer -g group1 -t topic -c test message -n 172.168.1.1:9876
89-
```
90-
- send delay message
80+
```
81+
82+
- send delay message
83+
9184
```shell
9285
./SendDelayMsg -g group1 -t topic -c test message -n 172.168.1.1:9876
93-
```
94-
- sync push consume message
86+
```
87+
88+
- sync push consume message
89+
9590
```shell
9691
./PushConsumer -g group1 -t topic -c test message -s sync -n 172.168.1.1:9876
97-
```
98-
- async push comsume message
92+
```
93+
94+
- async push comsume message
95+
9996
```shell
10097
./AsyncPushConsumer -g group1 -t topic -c test message -n 172.168.1.1:9876
101-
```
102-
- orderly sync push consume message
98+
```
99+
100+
- orderly sync push consume message
101+
103102
```shell
104103
./OrderlyPushConsumer -g group1 -t topic -c test message -s sync -n 172.168.1.1:9876
105-
```
106-
- orderly async push consume message
104+
```
105+
106+
- orderly async push consume message
107+
107108
```shell
108109
./OrderlyPushConsumer -g group1 -t topic -c test message -n 172.168.1.1:9876
109-
```
110-
- sync pull consume message
110+
```
111+
112+
- sync pull consume message
113+
111114
```shell
112115
./PullConsumer -g group1 -t topic -c test message -n 172.168.1.1:9876
113-
```
114-
### Parameters for tools ###
115-
```bash
116+
```
117+
118+
### Parameters for Tools
119+
```bash
116120
-n : nameserver addr, format is ip1:port;ip2:port
117121
-i : nameserver domain name, parameter -n and -i must have one.
118122
-g : groupName, contains producer groupName and consumer groupName
@@ -121,9 +125,11 @@ then execute follow command will auto use these library files to build rocketmq-
121125
-c : message content(default value: only test)
122126
-b : consume model(default value: CLUSTER)
123127
-a : set sync push(default value: async)
124-
-r : setup retry times(default value:5 times)
128+
-r : set retry times(default value:5 times)
125129
-u : select active broker to send message(default value: false)
126130
-d : use AutoDeleteSendcallback by cpp client(defalut value: false)
127131
-T : thread count of send msg or consume message(defalut value: system cpu core number)
128132
-v : print more details information
129133
```
134+
135+

0 commit comments

Comments
 (0)