-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added pulsar C++ client #185
Conversation
.travis.yml
Outdated
provider: releases | ||
api_key: | ||
secure: mIACMQlTzepBa9wWbKlME1Ig9/vKLHz63fn2zR2fbYjaAgXCPVe1lbTLbOZb62yB0XL7rUekyKIf0DEFH/cS1XjCb7aDKo4pLh6uiHdIIS8t1qEJJT54vbLwnWJXjo+14QHvaXgDlO/YoxpyOicrKI++b3fScD0zK2I8R6Lmwan/ZQze9uhRO0RKGChsDAszy+98C6JJxQXWQ0YjnUhwP5PtZX3Fm1rxtuCIk2Fl9gQdp9/j9U6vRKtWaO22Q2YaaaPGGoVyTwV6iMSOXDMb6zhjEQ3aiuJMJHUJRcGEU4fV7hkiUukWdo5+5C/mASNiJDYefG86KfCktMniPMzyAPXNc6hUzbOZuLNI1/f1QqBwzTJbH7NIUjz5f0hjNsHuYvkL8TcxE9pDA0Qkr8OIWR8M3+H7WKuiSTaVSeCobGBE8g6ymanlRvOQZblFpgw91B/KmZucsin0+rV5tVRlqTBYHL5f6fXEyhKdGYRiHaNR29mBBJsZng2tR6wVjPGqyEfdwFVOs44d2Rkt885VjZthap/Yw+SJKOvbJv1zaRglmbvbl629LvYOgT6ptYPDJyu/J/kzPrWnzvyTf72M6bR991Kx8gEkT4WRwCRBAuhg8i2bmIcsjbXtLcB0YRHgrBueJD0SuLREtcxJYvkgMI1UZon5UrCTkJDc0oFLO28= | ||
file_glob: true | ||
file: "all/target/pulsar-*.tar.gz" | ||
file: "pulsar-client-cpp/lib/libpulsar.*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the files that are uploaded to Github release page.
If we want to release binaries for C++ client, we should pack them into a deb/rpm package related to a specific ubuntu/rhel release.
I'd say, for now to skip this part and just release the sources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets leave it there if someone would like to consume until we generate package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhm, but that so file is depending on some specific version of dependencies libs, libstdc++, etc.. It would be pretty difficult to use as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats true. We were also debating the same. I'll remove it.
.travis.yml
Outdated
# Reconstruct the gpg keys to sign the artifacts | ||
before_deploy: | ||
- echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import --batch || true | ||
- echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust --batch || true | ||
|
||
install: | ||
- sudo apt-get install -y cmake libssl-dev libcurl4-openssl-dev liblog4cxx10-dev libprotobuf-dev libboost1.55-all-dev libgtest-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 parts could be enclosed in a bash script, to get more readability.
project (pulsar-cpp) | ||
|
||
set(Boost_NO_BOOST_CMAKE ON) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing that would be good to have is to get Pulsar version from the top level pom and add that as a compiler macro definition. This way the client will be able to report its own version to the broker (same as Java client).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed it in lib/CMakeLists.txt
@@ -0,0 +1,254 @@ | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using a special config file, we could change the tests to point to port 6650
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to leave the standalone port as it is since it might be running real workload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, no problem
.travis.yml
Outdated
# Reconstruct the gpg keys to sign the artifacts | ||
before_deploy: | ||
- echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import --batch || true | ||
- echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust --batch || true | ||
|
||
install: | ||
- sudo apt-get install -y cmake libssl-dev libcurl4-openssl-dev liblog4cxx10-dev libprotobuf-dev libboost1.55-all-dev libgtest-dev | ||
- pushd $HOME/ && wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz && popd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might also be good to cache both the tgz and the compiled stuff in travis, see line 6.
48c3f4e
to
18d5d61
Compare
pulsar-client-cpp/lib/CMakeLists.txt
Outdated
add_library(pulsarStatic STATIC ${PULSAR_SOURCES}) | ||
add_library(pulsarShared SHARED ${PULSAR_SOURCES}) | ||
|
||
set_target_properties(pulsarStatic PROPERTIES OUTPUT_NAME pulsar VERSION $ENV{LIB_VERSION}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, this will set the version on the compiled so library. I was thinking more about having a macro defined like -DPULSAR_VERSION="1.16"
in gcc command line. Then using a version.h
header that captures that and finally send the version to the broker in the connect command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, Just addressed it.
70898d5
to
862d019
Compare
#define LIB_VERSION_H_ | ||
|
||
#ifndef _PULSAR_VERSION_ | ||
#define _PULSAR_VERSION_ "1.17" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was meaning to use the version from the same variable, so that we don't need to remember to change it each time. 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is done by build.sh which reads from the pom file and defines it during compilation. The define here is to just have a default value. Maybe we can change it to undefined or remove the default. This way, compilation will fail if not defined and force user to define it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. Then maybe grepping for the version could be done directly inside the CMakelist.txt
so that it works even when not using build.sh script (not sure exactly how that works though).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed this in lib/CMakeLists.txt. Now, cmake itself will take care of it.
@saandrews @rdhabalia Added reading version from inside cmake definition here: |
Looks good to me. One final minor aks: can you rename build.sh into travis-build.sh? |
Updated. I will merge once CI is complete? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…ache#445) This case is usually encountered when attempting to use KoP with standalone mode. When new behavior was introduced in apache#168 standalone mode was broken due to sample namespace setup etc not taking place until after the broker is initialized (which in turn initializes protocol handlers). Fixes apache#185
Motivation
Added Pulsar C++ Client
Modifications
Added pulsar-client-cpp which contains C++ client implementation, relevant tests & tools
Result
Travis build will also produce libpulsar.so and libpulsar.a and deploy it under releases. The library is built using ubuntu14 since ubuntu16 environment is not yet available in travis. pulsar-client-cpp/README contains instruction to build it in ubuntu16