C++, GRPC based client for Google PubSub. Why? Simply because Google does not provide one.
- Requirements
- Install Dependencies
- Build
- Install
- In-source builds
- Versioning
- Contributing changes
- Licensing
Pubsuber is tested with the following compilers:
Compiler | Minimum Version |
---|---|
GCC | 9.0 |
Clang | 9.0.0 |
MSVC++ | 16.4 |
Apple Clang | 11.0.0 |
Pubsuber can be built with CMake. The minimal versions of cmake is 3.15
Pubsuber also depend on gRPC, protobuf, and google API proto files (committed in the repo). Pubsuber is tested with the following versions of these dependencies:
Library | Minimum version | Notes |
---|---|---|
gRPC | v1.24.x | |
protobuf | v3.10.1 | |
spdlog | v1.4.2 |
TODO: Integration tests at times use the Google pubsub emulator. The integration tests run against the latest version of the SDK on each commit and PR.
First install the development tools. Second install required dependencies. Its C++ land and its up to the developer to decide how to install the dependencies.
To build all available libraries and run the tests, run the following commands after cloning this repo:
# Add -DBUILD_TESTING=OFF to disable tests
mkdir .build
cd .build
cmake ..
# Adjust the number of threads used by modifying parameter for `-j 4`
# following command will also invoke ctest at the end
cmake --build cmake-out -- -j 4
# Verify build by running tests
ctest --output-on-failure
mkdir .build
cd .build
cmake ..
# Adjust the number of threads used by modifying parameter for `-j 4`
cmake --build cmake-out -- -j 4
# Verify build by running tests
ctest --output-on-failure
mkdir .build
cd .build
cmake ..
Open visual studio solution and build it
It is possible to have pubsuber as a part of your build subtree.
Using CMake it could be achieved by using FetchContent
module.
include(FetchContent)
fetchcontent_declare(pubsuber
GIT_REPOSITORY https://github.com/sandvikcode/pubsuber.git
GIT_TAG origin/develop)
fetchcontent_getproperties(pubsuber)
if(NOT pubsuber_POPULATED)
fetchcontent_populate(pubsuber)
add_subdirectory(${pubsuber_SOURCE_DIR} ${pubsuber_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
The default CMake builds for pubsuber
assume that all the necessary
dependencies are installed in your system. Installing the dependencies may be as simple as using the package manager for your platform, or may require manually downloading, compiling, and installing a number of additional libraries.
Assuming ~/install-test
is exist one can run follwing commands from the repo root:
mkdir .build && cd .build
cmake -DCMAKE_INSTALL_PREFIX=~/install-test ..
cmake -j4 install
Pubsuber client follows Semantic Versioning.
See CONTRIBUTING.md
for details on how to contribute to
this project, including how to build and test your changes as well as how to
properly format your code.
MIT; see LICENSE
for details.