BewareMyPower commented on code in PR #17580: URL: https://github.com/apache/pulsar/pull/17580#discussion_r969634656
########## site2/docs/client-libraries-cpp.md: ########## @@ -4,298 +4,192 @@ title: Pulsar C++ client sidebar_label: "C++" --- -You can use Pulsar C++ client to create Pulsar producers and consumers in C++. +````mdx-code-block +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +```` -All the methods in producer, consumer, and reader of a C++ client are thread-safe. +You can use a Pulsar C++ client to create producers, consumers, and readers. -## Supported platforms +All the methods in producer, consumer, and reader of a C++ client are thread-safe. You can read the Doxygen-generated [API docs](/api/cpp) for the C++ client -Pulsar C++ client is supported on **Linux**, **macOS** and **Windows** platforms. +## Installation -Doxygen-generated API docs for the C++ client are available [here](/api/cpp). +### Brew -## Linux +Install the latest tagged version with the library and headers: -:::note - -You can choose one of the following installation methods based on your needs: Compilation, Install RPM or Install Debian. - -::: - -### Compilation - -#### System requirements - -You need to install the following components before using the C++ client: - -* [CMake](https://cmake.org/) -* [Boost](http://www.boost.org/) -* [Protocol Buffers](https://developers.google.com/protocol-buffers/) >= 3 -* [libcurl](https://curl.se/libcurl/) -* [Google Test](https://github.com/google/googletest) - -1. Clone the Pulsar repository. - -```shell -git clone https://github.com/apache/pulsar +```bash +brew install libpulsar ``` -2. Install all necessary dependencies. +For more information, read [libpulsar formula's homepage](https://formulae.brew.sh/formula/libpulsar). -```shell -apt-get install cmake libssl-dev libcurl4-openssl-dev liblog4cxx-dev \ -libprotobuf-dev protobuf-compiler libboost-all-dev google-mock libgtest-dev libjsoncpp-dev -``` - -3. Compile and install [Google Test](https://github.com/google/googletest). +### Deb -```shell -# libgtest-dev version is 1.18.0 or above -cd /usr/src/googletest -sudo cmake . -sudo make -sudo cp ./googlemock/libgmock.a ./googlemock/gtest/libgtest.a /usr/lib/ +1. Download any one of the Deb packages: -# less than 1.18.0 -cd /usr/src/gtest -sudo cmake . -sudo make -sudo cp libgtest.a /usr/lib +<Tabs> +<TabItem value="client"> -cd /usr/src/gmock -sudo cmake . -sudo make -sudo cp libgmock.a /usr/lib +```bash +wget @pulsar:deb:client@ ``` -4. Compile the Pulsar client library for C++ inside the Pulsar repository. +</TabItem> +<TabItem value="client-devel"> -```shell -cd pulsar-client-cpp -cmake . -make +```bash +wget @pulsar:deb:client-devel@ ``` -After you install the components successfully, the files `libpulsar.so` and `libpulsar.a` are in the `lib` folder of the repository. The tools `perfProducer` and `perfConsumer` are in the `perf` directory. - -### Install Dependencies - -> Since 2.1.0 release, Pulsar ships pre-built RPM and Debian packages. You can download and install those packages directly. Review Comment: Yes. We can remove this section. https://github.com/apache/pulsar/tree/master/pulsar-client-cpp#compilation is intended for developers that want to build from source. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
