Examples for using the API to publish and consume messages can be found on https://github.com/yahoo/pulsar/tree/master/pulsar-client-cpp/examples
Pulsar C++ Client Library has been tested on:
apt-get install cmake libssl-dev libcurl4-openssl-dev liblog4cxx-dev \ libprotobuf-dev libboost-all-dev libgtest-dev
cd /usr/src/gtest sudo cmake . sudo make sudo cp *.a /usr/lib
cd pulsar/pulsar-client-cpp cmake . make
lib/libpulsar.so lib/libpulsar.a
perf/perfProducer perf/perfConsumer
# For openSSL brew install openssl export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include/ export OPENSSL_ROOT_DIR=/usr/local/opt/openssl/ # For Protobuf brew tap homebrew/versions brew install protobuf260 brew install boost brew install log4cxx # For gtest cd $HOME git clone https://github.com/google/googletest.git cd googletest cmake . make install ## Refer gtest documentation in case you get stuck somewhere
export $PULSAR_PATH=<Path where you cloned pulsar repo> cd ${PULSAR_PATH}/pulsar-client-cpp/ cmake . make
${PULSAR_PATH}/pulsar-client-cpp/lib/libpulsar.dylib ${PULSAR_PATH}/pulsar-client-cpp/lib/libpulsar.a
${PULSAR_PATH}/pulsar-client-cpp/perf/perfProducer ${PULSAR_PATH}/pulsar-client-cpp/perf/perfConsumer
# Source code ${PULSAR_PATH}/pulsar-client-cpp/tests/ # Execution ## Start standalone broker export PULSAR_STANDALONE_CONF=${PULSAR_PATH}/pulsar-client-cpp/tests/standalone.conf ${PULSAR_PATH}/bin/pulsar standalone ## Run the tests ${PULSAR_PATH}/pulsar-client-cpp/tests/main
We welcome contributions from the open source community, kindly make sure your changes are backward compatible with gcc-4.4.7 and Boost 1.41.