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.
Navigate to vcpkg-example for how to import the pulsar-client-cpp
into your project via vcpkg.
For non-vcpkg projects, you can download pre-built binaries from the official release page.
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.
Since it's integrated with vcpkg, see vcpkg::README for the requirements. See LEGACY_BUILD if you want to manage dependencies by yourself or you cannot install vcpkg in your own environment.
The 1st step will download vcpkg and then install all dependencies according to the version description in vcpkg.json. The 2nd step will build the Pulsar C++ libraries under ./build/lib/
, where ./build
is the CMake build directory.
After the build, the hierarchy of the build
directory will be:
To install the C++ headers and libraries into a specific path, e.g. /tmp/pulsar
, run the following commands:
For example, on macOS you will see:
Tests are built by default. You should execute run-unit-tests.sh to run tests locally.
If you don't want to build the tests, disable the BUILD_TESTS
option:
If you want to build the perf tools, enable the BUILD_PERF_TOOLS
option:
Then the perf tools will be built under ./build/perf/
.
Pulsar C++ Client Library has been tested on:
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.