C++ Kafka Client Library using Boost Asio
libkafka-asio
is a C++ header-only library, implementing the Kafka client
protocol. All Kafka APIs, including offset commit/fetch, are implemented:
It supports GZIP and Snappy message compression and therefore relies on the zlib and Snappy libraries. Message compression can optionally be turned off.
The library was tested on Linux (GCC 4.9, clang 3.5.1) and Windows (MSVC 10, 11, 12). There is a set of unit tests available under test
.
Add the lib
directory to your include paths and:
#include <libkafka_asio/libkafka_asio.h>
Please see the examples
directory for some examples on how to use the library.
Also consult the documentation: libkafka-asio Reference
libkafka-asio
depends on the Boost C++ libraries -- specially on Boost Asio. The following Boost sub-libraries are explicitly used in the project:
- boost asio
- boost bind
- boost crc
- boost foreach
- boost integer
- boost iterator
- boost optional
- boost smart ptr
- boost system
You need to link against boost_thread
and boost_system
.
So installing the boost library package on your distribution should do the trick (e.g. apt-get install libboost-dev
on Ubuntu, or pacman -S boost
on Arch).