commit | f7d61cd67c8f747aab56a53d6cb644efc3d85bae | [log] [tgz] |
---|---|---|
author | duheng <39583243+duhengforever@users.noreply.github.com> | Fri Nov 30 21:59:53 2018 +0800 |
committer | GitHub <noreply@github.com> | Fri Nov 30 21:59:53 2018 +0800 |
tree | dd57b7a707fe0d3045b5a84fa5e6bdcaed05d3cd | |
parent | 2667954a2d6ffcb59ad7ee172469fa3391901d8b [diff] | |
parent | c1ffdcb4e6fed3fb17122320aac459e9610d2eef [diff] |
Merge pull request #19 from jonnxu/master Update deploy script
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.
produce message, include sync and async 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.
doc/rocketmq-cpp_manaual_zh.docx
note: make sure the following compile tools or libraries with them minimum version number have been installed before run the build script build.sh
compile tools:
libraries:
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.
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.
sh build.sh
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.
g++ -o consumer_example consumer_example.cpp -lrocketmq -lpthread -lz -ldl -lrt
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
one key build script will automatic download dependency libraries include libevent json and boost, execute follow command,then it will build shared library.
win32_build.bat
if can't get internet to download four library source files by build script, you can copy four library source files
zlib-1.2.3-src Extract to $(rocketmq-client root dir)/thirdparty/zlib-1.2.3-src
libevent-release-2.0.22 Extract to $(rocketmq-client root dir)/thirdparty/libevent-release-2.0.22
boost_1_58_0 Extract to $(rocketmq-client root dir)/thirdparty/boost_1_58_0
jsoncpp-0.10.6 Extract to $(rocketmq-client root dir)/thirdparty/jsoncpp-0.10.6
then execute follow command will auto use these library files to build rocketmq-client.
win32_build.bat build
./SyncProducer -g group1 -t topic1 -c test message -n 172.168.1.1:9876
./AsyncProducer -g group1 -t topic -c test message -n 172.168.1.1:9876
./SendDelayMsg -g group1 -t topic -c test message -n 172.168.1.1:9876
./PushConsumer -g group1 -t topic -c test message -s sync -n 172.168.1.1:9876
./AsyncPushConsumer -g group1 -t topic -c test message -n 172.168.1.1:9876
./OrderlyPushConsumer -g group1 -t topic -c test message -s sync -n 172.168.1.1:9876
./OrderlyPushConsumer -g group1 -t topic -c test message -n 172.168.1.1:9876
./PullConsumer -g group1 -t topic -c test message -n 172.168.1.1:9876
-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