# RocketMQ-Client-CPP
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![TravisCI](https://travis-ci.org/apache/rocketmq-client-cpp.svg)](https://travis-ci.org/apache/rocketmq-client-cpp)
[![CodeCov](https://codecov.io/gh/apache/rocketmq-client-cpp/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/rocketmq-client-cpp)
[![GitHub release](https://img.shields.io/badge/release-download-default.svg)](https://github.com/apache/rocketmq-client-cpp/releases)
![Twitter Follow](https://img.shields.io/twitter/follow/ApacheRocketMQ?style=social)
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.
## Features
- produce messages, including normal and delayed messages, synchronously or asynchronously.
- consume messages, in cluster or broadcast model, concurrently or orderly
- c and c++ style API.
- cross-platform, all features are supported on Windows, Linux and Mac OS.
- automatically rebalanced, both in producing and consuming process.
- reliability, any downtime broker or name server has no impact on the client.
## Build and Install
### Linux and Mac OS
**note**: make sure the following compile tools or libraries have been installed before running the build script **build.sh**.
- compile tools:
- gcc-c++ 4.8.2: c++ compiler while need support C++11
- cmake 2.8.0: build jsoncpp require it
- automake 1.11.1: build libevent require it
- autoconf 2.65: build libevent require it
- libtool 2.2.6: build libevent require it
- libraries:
- bzip2-devel 1.0.6: boost depend it
- zlib-devel
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.7](https://github.com/open-source-parsers/jsoncpp/archive/0.10.7.zip "jsoncpp 0.10.7"), [boost 1.58.0](http://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.gz "boost 1.58.0")
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.7.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:
sh build.sh
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:
g++ -o consumer_example consumer_example.cpp -lrocketmq -lpthread -lz -ldl -lrt
### Windows
**note**: make sure the following compile tools or libraries have been installed before running the build script **win32_build.bat**:
- compile tools:
- vs2015: libevent,jsoncpp,zlib,boost rocket-client require it
- git: download source code
The build script will automatically download dependent libraries including libevent json and boost to build shared library:
win32_build.bat
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
[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
[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
[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
[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
And then run following command to build x86 rocketmq-client:
win32_build.bat build
to build x64 rocketmq-client:
win32_build.bat build64
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
rocketmq-client-cpp-release-2.1.0.rar (360个子文件)
release-2.2.0 190B
release-2.1.0 190B
release-2.2.0 41B
release-2.1.0 41B
win32_build.bat 4KB
sha512.c 21KB
sha256.c 17KB
sha1.c 16KB
base64.c 12KB
spas_client.c 12KB
hmac.c 4KB
param_list.c 4KB
PullConsumeMessage.c 3KB
COrderlyAsyncProducer.c 3KB
CAsyncProducer.c 3KB
Producer.c 2KB
CBatchProducer.c 2KB
PushConsumeMessage.c 2KB
PushConsumerOrderly.c 2KB
.clang-format 55B
FindLibevent.cmake 6KB
FindJsoncpp.cmake 3KB
config 460B
control 264B
MQClientFactory.cpp 48KB
DefaultMQPushConsumerImpl.cpp 44KB
MQClientAPIImpl.cpp 38KB
CProducer.cpp 29KB
CommandHeader.cpp 29KB
DefaultMQProducerImpl.cpp 27KB
Rebalance.cpp 27KB
TcpRemotingClient.cpp 23KB
CommandHeaderTest.cpp 20KB
DefaultMQPullConsumerImpl.cpp 16KB
OffsetStore.cpp 13KB
ConsumeMessageConcurrentlyService.cpp 13KB
ConsumeMessageOrderlyService.cpp 11KB
CProducerTest.cpp 11KB
RemotingCommandTest.cpp 11KB
UtilAll.cpp 11KB
TcpTransport.cpp 10KB
CPushConsumer.cpp 10KB
MQClientAPIImpTest.cpp 10KB
DefaultMQProducerImplTest.cpp 10KB
RemotingCommand.cpp 9KB
TransactionMQProducerImpl.cpp 9KB
PullRequest.cpp 9KB
ClientRemotingProcessorTest.cpp 9KB
DefaultMQClient.cpp 9KB
CPullConsumer.cpp 9KB
CPullConsumerTest.cpp 8KB
MQMessage.cpp 8KB
MQDecoder.cpp 8KB
AsyncCallbackWrap.cpp 8KB
DefaultMQProducer.cpp 8KB
ClientRemotingProcessor.cpp 7KB
DefaultMQPushConsumer.cpp 7KB
MemoryOutputStreamTest.cpp 7KB
EventLoop.cpp 7KB
DefaultMQPullConsumer.cpp 7KB
CPushConsumerTest.cpp 7KB
TransactionMQProducer.cpp 7KB
MQDecoderTest.cpp 7KB
dataBlock.cpp 6KB
MemoryBlockTest.cpp 6KB
PullAPIWrapper.cpp 6KB
sync_http_client.cpp 6KB
MQMessageTest.cpp 6KB
MQClientFactoryTest.cpp 5KB
ResponseFuture.cpp 5KB
TransactionProducer.cpp 5KB
MQMessageExtTest.cpp 5KB
TraceUtil.cpp 5KB
MQMessageExt.cpp 5KB
MemoryOutputStream.cpp 5KB
ConsumeMessageHookImpl.cpp 5KB
DefaultMQPushConsumerImplTest.cpp 5KB
ResponseFutureTest.cpp 4KB
StringIdMaker.cpp 4KB
LockBatchBody.cpp 4KB
BatchProducer.cpp 4KB
ConsumerRunningInfo.cpp 4KB
Logging.cpp 4KB
AsyncProducer.cpp 4KB
SendMessageHookImpl.cpp 4KB
ConsumerRunningInfoTest.cpp 4KB
UtilAllTest.cpp 4KB
CMessageExtTest.cpp 4KB
NameSpaceUtilTest.cpp 4KB
PullConsumer.cpp 4KB
LockBatchBodyTest.cpp 4KB
PushConsumer.cpp 4KB
NameSpaceUtil.cpp 4KB
HeartbeatDataTest.cpp 4KB
TopicPublishInfoTest.cpp 4KB
CMessageTest.cpp 4KB
SyncProducer.cpp 4KB
SendResult.cpp 4KB
SubscriptionData.cpp 4KB
Validators.cpp 4KB
共 360 条
- 1
- 2
- 3
- 4
资源评论
三雷科技
- 粉丝: 4w+
- 资源: 408
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功