Skip to content

Commit

Permalink
tools/kafka_repeater: use librdkafka v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SwimmingTiger committed Aug 7, 2019
1 parent 0afa1a8 commit fe7f774
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tools/kafka_repeater/CMakeLists.txt
Expand Up @@ -47,7 +47,7 @@ include_directories(${PROJECT_ROOT}/3rdparty ${PROJECT_ROOT}/src ${PROJECT_ROOT}

set(THIRD_LIBRARIES ${GLOG_LIBRARIES} ${KAFKA_LIBRARIES} ${LIBCONFIGPP_LIBRARY} ${Boost_LIBRARIES}
${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ${PTHREAD_LIBRARIES} ${ZLIB_LIBRARIES}
${SASL2_LIBRARIES})
${SASL2_LIBRARIES} -ldl)

file(GLOB SOURCES
${PROJECT_ROOT}/src/Kafka.cc
Expand Down
6 changes: 3 additions & 3 deletions tools/kafka_repeater/Dockerfile
Expand Up @@ -38,9 +38,9 @@ RUN apt-get update && apt-get install -y \
# Remove dynamic libraries of librdkafka
# In this way, the constructed deb package will
# not have dependencies that not from software sources.
RUN cd /tmp && wget https://github.com/edenhill/librdkafka/archive/0.9.1.tar.gz && \
[ $(sha256sum 0.9.1.tar.gz | cut -d " " -f 1) = "5ad57e0c9a4ec8121e19f13f05bacc41556489dfe8f46ff509af567fdee98d82" ] && \
tar zxf 0.9.1.tar.gz && cd librdkafka-0.9.1 && \
RUN cd /tmp && wget https://github.com/edenhill/librdkafka/archive/v1.1.0.tar.gz && \
[ $(sha256sum v1.1.0.tar.gz | cut -d " " -f 1) = "123b47404c16bcde194b4bd1221c21fdce832ad12912bd8074f88f64b2b86f2b" ] && \
tar zxf v1.1.0.tar.gz && cd librdkafka-1.1.0 && \
./configure && make && make install && rm -rf /tmp/* && \
cd /usr/local/lib && \
find . | grep 'rdkafka' | grep '.so' | xargs rm
Expand Down
14 changes: 14 additions & 0 deletions tools/kafka_repeater/README.md
Expand Up @@ -26,6 +26,16 @@ apt-get update && apt-get install -y \
wget \
zlib1g-dev

# Build librdkafka static library
# Remove dynamic libraries of librdkafka
# In this way, the constructed deb package will
# not have dependencies that not from software sources.
wget https://github.com/edenhill/librdkafka/archive/v1.1.0.tar.gz
tar zxf v1.1.0.tar.gz
cd librdkafka-1.1.0
./configure && make && make install
cd /usr/local/lib && find . | grep 'rdkafka' | grep '.so' | xargs rm

mkdir build
cd build
cmake ..
Expand Down Expand Up @@ -87,6 +97,8 @@ kafka = {
username = "test";
password = "123";
};
# debug options
debug = "all";
};
...
Expand Down Expand Up @@ -148,6 +160,8 @@ docker run -it --restart always -d \
-e kafka_out_topic="testout" \
-e kafka_out_use_ssl="true" \
-e kafka_ssl_ca_content="<cert-text>" \
-e kafka_ssl_certificate_content="<cert-text>" \
-e kafka_ssl_key_content="<cert-text>" \
-e kafka_sasl_username="test" \
-e kafka_sasl_password="123" \
kafka-repeater
Expand Down

0 comments on commit fe7f774

Please sign in to comment.