Skip to main content
Version: 5.0

C++ Client SDK

Info

This section introduces sending and receiving messages using Apache RocketMQ 5.0 gRPC protocol C++ SDK.

info
  • This sample code is built based on the gRPC protocol SDK. Therefore, the server needs to be upgraded to at least version 5.0 and enable gRPC Proxy to be compatible. Please refer to the quick start guide for deploying Proxy.
  • If you are using the Remoting protocol SDK, it is recommended to refer to the example code of the previous version 4.x for running. To identify the type of SDK you are using, please refer to the overview.

CodeExample

Here is the link to the sample code for message sending and receiving using the Apache RocketMQ gRPC protocol C++ SDK. The complete code project and runtime environment can be found in the rocketmq-clients repository. Please refer to it for configuration and running.

MessageTypesProducer ExamplesPushConsumer ExamplesSimpleConsumer Examples
NormalMessageSync Send Example:ExampleProducer.cpp
Async Send Example:ExampleProducerWithAsync.cpp
ExamplePushConsumer.cppExampleSimpleConsumer.cpp
FIFOMessageExampleProducerWithFifoMessage.cppExamplePushConsumer.cppExampleSimpleConsumer.cpp
DelayMessageExampleProducerWithTimedMessage.cppExamplePushConsumer.cppExampleSimpleConsumer.cpp
TransactionMessageExampleProducerWithTransactionalMessage.cppExamplePushConsumer.cppExampleSimpleConsumer.cpp