{"id":15329893,"url":"https://github.com/shibd/pulsar-client-cpp","last_synced_at":"2025-10-09T22:33:01.336Z","repository":{"id":64311466,"uuid":"547241527","full_name":"shibd/pulsar-client-cpp","owner":"shibd","description":"Apache Pulsar C++ client library","archived":false,"fork":true,"pushed_at":"2024-11-25T13:15:18.000Z","size":6690,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-27T15:40:44.047Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pulsar.apache.org/","language":"C++","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"apache/pulsar-client-cpp","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shibd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2022-10-07T11:08:51.000Z","updated_at":"2022-10-10T08:29:51.000Z","dependencies_parsed_at":"2023-02-10T21:31:11.679Z","dependency_job_id":null,"html_url":"https://github.com/shibd/pulsar-client-cpp","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/shibd/pulsar-client-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shibd%2Fpulsar-client-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shibd%2Fpulsar-client-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shibd%2Fpulsar-client-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shibd%2Fpulsar-client-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shibd","download_url":"https://codeload.github.com/shibd/pulsar-client-cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shibd%2Fpulsar-client-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002106,"owners_count":26083307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T09:50:32.018Z","updated_at":"2025-10-09T22:33:00.860Z","avatar_url":"https://github.com/shibd.png","language":"C++","readme":"\u003c!--\n\n    Licensed to the Apache Software Foundation (ASF) under one\n    or more contributor license agreements.  See the NOTICE file\n    distributed with this work for additional information\n    regarding copyright ownership.  The ASF licenses this file\n    to you under the Apache License, Version 2.0 (the\n    \"License\"); you may not use this file except in compliance\n    with the License.  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing,\n    software distributed under the License is distributed on an\n    \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n    KIND, either express or implied.  See the License for the\n    specific language governing permissions and limitations\n    under the License.\n\n--\u003e\n\n# Pulsar C++ client library\n\nPulsar C++ clients support a variety of Pulsar features to enable building applications connecting to your Pulsar cluster.\n\nFor the supported Pulsar features, see [Client Feature Matrix](https://pulsar.apache.org/client-feature-matrix/).\n\nFor how to use APIs to publish and consume messages, see [examples](https://github.com/apache/pulsar-client-cpp/tree/main/examples).\n\n## Generate the API documents\n\nPulsar C++ client uses [doxygen](https://www.doxygen.nl) 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.\n\n## Requirements\n\n- A C++ compiler that supports C++11, like GCC \u003e= 4.8\n- CMake \u003e= 3.13\n- [Boost](http://www.boost.org/)\n- [Protocol Buffer](https://developers.google.com/protocol-buffers/) \u003e= 3\n- [libcurl](https://curl.se/libcurl/)\n- [openssl](https://github.com/openssl/openssl)\n\nThe default supported [compression types](include/pulsar/CompressionType.h) are:\n\n- `CompressionNone`\n- `CompressionLZ4`\n\nIf you want to enable other compression types, you need to install:\n\n- `CompressionZLib`: [zlib](https://zlib.net/)\n- `CompressionZSTD`: [zstd](https://github.com/facebook/zstd)\n- `CompressionSNAPPY`: [snappy](https://github.com/google/snappy)\n\nIf you want to build and run the tests, you need to install [GTest](https://github.com/google/googletest). Otherwise, you need to add CMake option `-DBUILD_TESTS=OFF`.\n\nThe [dependencies.yaml](./dependencies.yaml) file provides the recommended dependency versions, while you can still build from source with other dependency versions. If a dependency requires a higher C++ standard, e.g. C++14, you can specify the standard like:\n\n```bash\ncmake . -DCMAKE_CXX_STANDARD=14\n```\n\n\u003e **Note**:\n\u003e\n\u003e On macOS, the default C++ standard is 17 because the latest Protobuf from Homebrew requires the C++17 support.\n\n## Platforms\n\nPulsar C++ Client Library has been tested on:\n\n- Linux\n- Mac OS X\n- Windows x64\n\n## Compilation\n\n### Clone\n\nFirst of all, clone the source code:\n\n```shell\ngit clone https://github.com/apache/pulsar-client-cpp\ncd pulsar-client-cpp\n```\n\n### Compile on Ubuntu\n\n#### Install all dependencies:\n\n```shell\nsudo apt-get update -y \u0026\u0026 sudo apt-get install -y g++ cmake libssl-dev libcurl4-openssl-dev \\\n                libprotobuf-dev libboost-all-dev libgtest-dev libgmock-dev \\\n                protobuf-compiler\n```\n\n#### Compile Pulsar client library:\n\n```shell\ncmake .\nmake\n```\n\nIf you want to build performance tools, you need to run:\n\n```shell\ncmake . -DBUILD_PERF_TOOLS=ON\nmake\n```\n\n#### Checks\n\nClient library will be placed in:\n\n```\nlib/libpulsar.so\nlib/libpulsar.a\n```\n\nExamples will be placed in:\n\n```\nexamples/\n```\n\nTools will be placed in:\n\n```\nperf/perfProducer\nperf/perfConsumer\n```\n\n### Compile on Mac OS X\n\n#### Install all dependencies:\n\n```shell\nbrew install cmake openssl protobuf boost googletest zstd snappy\n```\n\n#### Compile Pulsar client library:\n\n```shell\ncmake .\nmake\n```\n\nIf you want to build performance tools, you need to run:\n\n```shell\ncmake . -DBUILD_PERF_TOOLS=ON\nmake\n```\n\n#### Checks\n\nClient library will be placed in:\n\n```\nlib/libpulsar.dylib\nlib/libpulsar.a\n```\n\nExamples will be placed in:\n\n```\nexamples/\n```\n\nTools will be placed in:\n\n```\nperf/perfProducer\nperf/perfConsumer\n```\n\n### Compile on Windows\n\n#### Install with [vcpkg](https://github.com/microsoft/vcpkg)\n\nIt'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](https://github.com/microsoft/vcpkg#quick-start-windows) for quick start.\n\nTake Windows 64-bit library as an example, you only need to run\n\n```bash\nvcpkg install --feature-flags=manifests --triplet x64-windows\n```\n\n\u003e **NOTE**:\n\u003e\n\u003e For Windows 32-bit library, change `x64-windows` to `x86-windows`, see [here](https://github.com/microsoft/vcpkg/blob/master/docs/users/triplets.md) for more details about the triplet concept in Vcpkg.\n\nThe all dependencies, which are specified by [vcpkg.json](vcpkg.json), will be installed in `vcpkg_installed/` subdirectory,\n\nWith `vcpkg`, you only need to run two commands:\n\n```bash\ncmake \\\n -B ./build \\\n -A x64 \\\n -DBUILD_TESTS=OFF \\\n -DVCPKG_TRIPLET=x64-windows \\\n -DCMAKE_BUILD_TYPE=Release \\\n -S .\ncmake --build ./build --config Release\n```\n\nThen all artifacts will be built into `build` subdirectory.\n\n\u003e **NOTE**:\n\u003e\n\u003e 1. For Windows 32-bit, you need to use `-A Win32` and `-DVCPKG_TRIPLET=x86-windows`.\n\u003e 2. For MSVC Debug mode, you need to replace `Release` with `Debug` for both `CMAKE_BUILD_TYPE` variable and `--config` option.\n\n#### Install dependencies manually\n\nYou need to install [dlfcn-win32](https://github.com/dlfcn-win32/dlfcn-win32) in addition.\n\nIf you installed the dependencies manually, you need to run\n\n```shell\n#If all dependencies are in your path, all that is necessary is\ncmake .\n\n#if all dependencies are not in your path, then passing in a PROTOC_PATH and CMAKE_PREFIX_PATH is necessary\ncmake -DPROTOC_PATH=C:/protobuf/bin/protoc -DCMAKE_PREFIX_PATH=\"C:/boost;C:/openssl;C:/zlib;C:/curl;C:/protobuf;C:/googletest;C:/dlfcn-win32\" .\n\n#This will generate pulsar-cpp.sln. Open this in Visual Studio and build the desired configurations.\n```\n\n#### Checks\n\nClient library will be placed in:\n\n```\nbuild/lib/Release/pulsar.lib\nbuild/lib/Release/pulsar.dll\n```\n\n#### Examples\n\nAdd Windows environment paths:\n\n```\nbuild/lib/Release\nvcpkg_installed\n```\n\nExamples will be available in:\n\n```\nbuild/examples/Release\n```\n\n## Tests\n\n```shell\n# Execution\n# Start standalone broker\n./pulsar-test-service-start.sh\n\n# Run the tests\ncd tests\n./pulsar-tests\n\n# When no longer needed, stop standalone broker\n./pulsar-test-service-stop.sh\n```\n\n## Wireshark Dissector\n\nSee the [wireshark](wireshark/) directory for details.\n\n## Requirements for Contributors\n\nIt's required to install [LLVM](https://llvm.org/builds/) for `clang-tidy` and `clang-format`. Pulsar C++ client use `clang-format` **11** to format files. `make format` automatically formats the files.\n\nFor 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.\n\nWe welcome contributions from the open source community, kindly make sure your changes are backward compatible with GCC 4.8 and Boost 1.53.\n\nIf your contribution adds Pulsar features for C++ clients, you need to update both the [Pulsar docs](https://pulsar.apache.org/docs/client-libraries/) and the [Client Feature Matrix](https://pulsar.apache.org/client-feature-matrix/). See [Contribution Guide](https://pulsar.apache.org/contribute/site-intro/#pages) for more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshibd%2Fpulsar-client-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshibd%2Fpulsar-client-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshibd%2Fpulsar-client-cpp/lists"}