pulsar-client-cpp
|
Pulsar C++ clients support a variety of Pulsar features to enable building applications connecting to your Pulsar cluster.
For the supported Pulsar features, see Client Feature Matrix.
For how to use APIs to publish and consume messages, see examples.
Pulsar C++ client uses doxygen to build API documents. After installing doxygen
, you only need to run doxygen
to generate the API documents whose main page is under the doxygen/html/index.html
path.
The default supported compression types are:
CompressionNone
CompressionLZ4
If you want to enable other compression types, you need to install:
If you want to build and run the tests, you need to install GTest. Otherwise, you need to add CMake option -DBUILD_TESTS=OFF
.
If you want to use ClientConfiguration::setLogConfFilePath
, you need to install the Log4CXX and add CMake option -DUSE_LOG4CXX=ON
.
Pulsar C++ Client Library has been tested on:
First of all, clone the source code:
If you want to build performance tools, you need to run:
Client library will be placed in:
Examples will be placed in:
Tools will be placed in:
If you want to build performance tools, you need to run:
Client library will be placed in:
Examples will be placed in:
Tools will be placed in:
It's highly recommended to use vcpkg
for C++ package management on Windows. It's easy to install and well supported by Visual Studio (2015/2017/2019) and CMake. See here for quick start.
Take Windows 64-bit library as an example, you only need to run
NOTE:
For Windows 32-bit library, change
x64-windows
tox86-windows
, see here for more details about the triplet concept in Vcpkg.
The all dependencies, which are specified by vcpkg.json, will be installed in vcpkg_installed/
subdirectory,
With vcpkg
, you only need to run two commands:
Then all artifacts will be built into build
subdirectory.
NOTE:
- For Windows 32-bit, you need to use
-A Win32
and-DVCPKG_TRIPLET=x86-windows
.- For MSVC Debug mode, you need to replace
Release
withDebug
for bothCMAKE_BUILD_TYPE
variable and--config
option.
You need to install dlfcn-win32 in addition.
If you installed the dependencies manually, you need to run
Client library will be placed in:
Add Windows environment paths:
Examples will be available in:
See the wireshark directory for details.
It's required to install LLVM for clang-tidy
and clang-format
. Pulsar C++ client use clang-format
11 to format files. make format
automatically formats the files.
For Ubuntu users, you can install clang-format-11
via apt install clang-format-11
. For other users, run ./build-support/docker-format.sh
if you have Docker installed.
We welcome contributions from the open source community, kindly make sure your changes are backward compatible with GCC 4.8 and Boost 1.53.
If your contribution adds Pulsar features for C++ clients, you need to update both the Pulsar docs and the Client Feature Matrix. See Contribution Guide for more details.