You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
4
4
5
-
## Features ##
5
+
## Features
6
6
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.
8
13
9
-
- consume message, include concurrency and orderly consume message, broadcast and cluster consume model.
14
+
## Build and Install
10
15
11
-
- rebalance, include both produce message and consume message with rebalance.
16
+
### Linux and Mac OS
12
17
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.
**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**.
32
19
33
20
- compile tools:
34
21
- 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
40
27
- libraries:
41
28
- bzip2-devel 1.0.6: boost depend it
42
29
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")
44
31
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:
46
33
47
34
sh build.sh
48
35
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:
**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
+
55
43
- compile tools:
56
44
- vs2015: libevent,jsoncpp,zlib,boost rocket-client require it
57
45
- git: download source code
58
46
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:
60
48
61
49
win32_build.bat
62
50
63
51
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
65
53
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
67
55
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
69
57
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
71
59
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
73
61
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:
75
63
76
64
win32_build.bat build
77
65
78
66
79
-
## Quick Start ##
80
-
### tools and commands ###
67
+
## Quick Start
68
+
### Tools and Commands
69
+
70
+
- sync produce message
81
71
82
-
- sync produce message
83
72
```shell
84
73
./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
+
87
78
```shell
88
79
./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
+
91
84
```shell
92
85
./SendDelayMsg -g group1 -t topic -c test message -n 172.168.1.1:9876
0 commit comments