-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
146 changed files
with
37,598 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
*.os | ||
*.scons* | ||
|
||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
*.dll | ||
*.so.1 | ||
|
||
# Compiled Static libraries | ||
*.lai | ||
*.la | ||
*.a | ||
*.lib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
|
||
# Dependency file | ||
*.d | ||
|
||
# Mac swap file | ||
*.DS_Store | ||
|
||
# Linux swap file | ||
*.swp | ||
|
||
# Exclude compiled executables | ||
/examples/SampleProducer | ||
/examples/SampleConsumer | ||
/examples/SampleAsyncProducer | ||
/examples/SampleConsumerListener | ||
/tests/main | ||
/perf/PerfProducer | ||
/perf/PerfConsumer | ||
/system-test/SystemTest | ||
|
||
# Eclipse generated files | ||
.cproject | ||
.project | ||
.settings/ | ||
.pydevproject | ||
|
||
# doxygen files | ||
apidocs/ | ||
|
||
# CMAKE | ||
Makefile | ||
cmake_install.cmake | ||
CMakeFiles | ||
CMakeCache.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# | ||
# Copyright 2016 Yahoo Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
cmake_minimum_required(VERSION 2.8) | ||
project (pulsar-cpp) | ||
|
||
set(Boost_NO_BOOST_CMAKE ON) | ||
|
||
set (CMAKE_CXX_FLAGS "-Wno-deprecated-declarations ${CMAKE_CXX_FLAGS}") | ||
|
||
find_package(Boost REQUIRED COMPONENTS program_options filesystem regex thread system) | ||
find_package(OpenSSL REQUIRED) | ||
find_package(ZLIB REQUIRED) | ||
find_package(ProtoBuf QUIET) | ||
if(NOT ProtoBuf_FOUND) | ||
find_library(PROTOBUF_LIBRARIES protobuf) | ||
endif() | ||
find_library(LOG4CXX_LIBRARY_PATH log4cxx) | ||
find_library(CURL_LIBRARY_PATH curl) | ||
find_path(LOG4CXX_INCLUDE_PATH log4cxx/logger.h) | ||
|
||
include_directories( | ||
${CMAKE_SOURCE_DIR} | ||
${CMAKE_SOURCE_DIR}/include | ||
${Boost_INCLUDE_DIR} | ||
${OPENSSL_INCLUDE_DIR} | ||
${ZLIB_INCLUDE_DIR} | ||
${PROTOBUF_INCLUDE_DIR} | ||
${LOG4CXX_INCLUDE_PATH} | ||
) | ||
|
||
set(COMMON_LIBS | ||
${COMMON_LIBS} | ||
${Boost_LIBRARIES} | ||
${OPENSSL_LIBRARIES} | ||
${ZLIB_LIBRARIES} | ||
${PROTOBUF_LIBRARIES} | ||
${LOG4CXX_LIBRARY_PATH} | ||
${CURL_LIBRARY_PATH} | ||
) | ||
|
||
link_directories(${CMAKE_BINARY_DIR}/lib) | ||
|
||
set(CLIENT_LIBS | ||
${COMMON_LIBS} | ||
pulsar | ||
) | ||
|
||
add_subdirectory(lib) | ||
add_subdirectory(perf) | ||
add_subdirectory(examples) | ||
add_subdirectory(tests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
Pulsar C++ Client Library | ||
|
||
Copyright 2016 Yahoo Inc. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
||
|
||
This product contain sources from LZ4 - Fast LZ compression algorithm: | ||
* Copyright (C) 2011-2015, Yann Collet. | ||
* LICENSE: BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) | ||
* HOMEPAGE: https://github.com/Cyan4973/lz4 | ||
|
||
|
||
This product contains sources from Circe CRC library: | ||
* Copyright 2014 Trevor Robinson | ||
* LICENSE : Apache License, Version 2.0 | ||
* HOMEPAGE: https://github.com/trevorr/circe | ||
|
||
This product contains sources from Adler CRC32c implementation: | ||
* Copyright (C) 2013 Mark Adler | ||
* LICENSE: ZLib License (https://opensource.org/licenses/Zlib) | ||
* HOMEPAGE: https://github.com/baruch/crcbench/blob/master/crc-mark-adler.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
|
||
### Pulsar C++ client library | ||
|
||
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 | ||
|
||
#### Requirements | ||
|
||
* CMake | ||
* Boost | ||
* [Protocol Buffer 2.6](https://developers.google.com/protocol-buffers/) | ||
* [Log4CXX](https://logging.apache.org/log4cxx) | ||
* LibCurl | ||
* [GTest](https://github.com/google/googletest) | ||
|
||
|
||
#### Compile on Ubuntu Server 16.04 | ||
|
||
Install all dependencies: | ||
|
||
```shell | ||
apt-get install cmake libssl-dev libcurl4-openssl-dev liblog4cxx-dev \ | ||
libprotobuf-dev libboost-all-dev libgtest-dev | ||
``` | ||
|
||
Compile and install Google Test: | ||
|
||
```shell | ||
cd /usr/src/gtest | ||
sudo cmake . | ||
sudo make | ||
sudo cp *.a /usr/lib | ||
``` | ||
|
||
|
||
Compile Pulsar client library: | ||
|
||
```shell | ||
cd pulsar/pulsar-client-cpp | ||
cmake . | ||
make | ||
``` | ||
|
||
Client library will be placed in | ||
``` | ||
lib/libpulsar.so | ||
lib/libpulsar.a | ||
``` | ||
|
||
Tools : | ||
|
||
``` | ||
perf/perfProducer | ||
perf/perfConsumer | ||
``` | ||
|
||
Tests: | ||
|
||
``` | ||
1. Start the standalone pulsar | ||
export PULSAR_STANDALONE_CONF=tests/standalone.conf | ||
../bin/pulsar standalone | ||
2. Run tests | ||
tests/main | ||
``` |
Oops, something went wrong.