All Projects â†’ mfontanini â†’ Cppkafka

mfontanini / Cppkafka

Licence: bsd-2-clause
Modern C++ Apache Kafka client library (wrapper for librdkafka)

Projects that are alternatives of or similar to Cppkafka

Awesome Kafka
A list about Apache Kafka
Stars: ✭ 397 (-3.87%)
Mutual labels:  apache-kafka, kafka
Azkarra Streams
🚀 Azkarra is a lightweight java framework to make it easy to develop, deploy and manage cloud-native streaming microservices based on Apache Kafka Streams.
Stars: ✭ 146 (-64.65%)
Mutual labels:  apache-kafka, kafka
Docker Kafka
Apache Kafka on Docker
Stars: ✭ 143 (-65.38%)
Mutual labels:  apache-kafka, kafka
Slimmessagebus
Lightweight message bus interface for .NET (pub/sub and request-response) with transport plugins for popular message brokers.
Stars: ✭ 120 (-70.94%)
Mutual labels:  apache-kafka, kafka
Cp All In One
docker-compose.yml files for cp-all-in-one , cp-all-in-one-community, cp-all-in-one-cloud
Stars: ✭ 239 (-42.13%)
Mutual labels:  apache-kafka, kafka
Azure Event Hubs For Kafka
Azure Event Hubs for Apache Kafka Ecosystems
Stars: ✭ 124 (-69.98%)
Mutual labels:  apache-kafka, kafka
Kafka Tutorials
Kafka Tutorials microsite
Stars: ✭ 144 (-65.13%)
Mutual labels:  apache-kafka, kafka
Kattlo Cli
Kattlo CLI Project
Stars: ✭ 58 (-85.96%)
Mutual labels:  apache-kafka, kafka
Kafka Sprout
🚀 Web GUI for Kafka Cluster Management
Stars: ✭ 388 (-6.05%)
Mutual labels:  apache-kafka, kafka
Kafkactl
Command Line Tool for managing Apache Kafka
Stars: ✭ 177 (-57.14%)
Mutual labels:  apache-kafka, kafka
Meetup
Kafka 한ęĩ­ ė‚ŽėšĐėž ëŠĻėž„ė—ė„œ ėšīė˜í•˜ëŠ” meetup repository
Stars: ✭ 106 (-74.33%)
Mutual labels:  apache-kafka, kafka
Wirbelsturm
Wirbelsturm is a Vagrant and Puppet based tool to perform 1-click local and remote deployments, with a focus on big data tech like Kafka.
Stars: ✭ 332 (-19.61%)
Mutual labels:  apache-kafka, kafka
Kukulcan
A REPL for Apache Kafka
Stars: ✭ 103 (-75.06%)
Mutual labels:  apache-kafka, kafka
Waterdrop
WaterDrop is a standalone Karafka component library for generating Kafka messages
Stars: ✭ 136 (-67.07%)
Mutual labels:  apache-kafka, kafka
Karafka
Framework for Apache Kafka based Ruby and Rails applications development.
Stars: ✭ 1,223 (+196.13%)
Mutual labels:  apache-kafka, kafka
Oryx
Oryx 2: Lambda architecture on Apache Spark, Apache Kafka for real-time large scale machine learning
Stars: ✭ 1,785 (+332.2%)
Mutual labels:  apache-kafka, kafka
Kowl
Apache Kafka Web UI for exploring messages, consumers, configurations and more with a focus on a good UI & UX.
Stars: ✭ 1,036 (+150.85%)
Mutual labels:  apache-kafka, kafka
Pykafka
Apache Kafka client for Python; high-level & low-level consumer/producer, with great performance.
Stars: ✭ 1,079 (+161.26%)
Mutual labels:  apache-kafka, kafka
Kop
Kafka-on-Pulsar - A protocol handler that brings native Kafka protocol to Apache Pulsar
Stars: ✭ 159 (-61.5%)
Mutual labels:  apache-kafka, kafka
Kafka Ui
Open-Source Web GUI for Apache Kafka Management
Stars: ✭ 230 (-44.31%)
Mutual labels:  apache-kafka, kafka

cppkafka: high level C++ wrapper for rdkafka

Build status

cppkafka allows C++ applications to consume and produce messages using the Apache Kafka protocol. The library is built on top of librdkafka, and provides a high level API that uses modern C++ features to make it easier to write code while keeping the wrapper's performance overhead to a minimum.

Features

  • cppkafka is a high level C++ wrapper for rdkafka, aiming to allow using rdkafka in a simple, less error prone way.

  • cppkafka provides an API to produce messages as well as consuming messages, but the latter is only supported via the high level consumer API. cppkafka requires rdkafka >= 0.9.4 in order to use it. Other wrapped functionalities are also provided, like fetching metadata, offsets, etc.

  • cppkafka provides message header support. This feature requires rdkafka >= 0.11.4.

  • cppkafka tries to add minimal overhead over librdkafka. A very thin wrapper for librdkafka messages is used for consumption so there's virtually no overhead at all.

It's simple!

cppkafka's API is simple to use. For example, this code creates a producer that writes a message into some partition:

#include <cppkafka/cppkafka.h>

using namespace std;
using namespace cppkafka;

int main() {
    // Create the config
    Configuration config = {
        { "metadata.broker.list", "127.0.0.1:9092" }
    };

    // Create the producer
    Producer producer(config);

    // Produce a message!
    string message = "hey there!";
    producer.produce(MessageBuilder("my_topic").partition(0).payload(message));
    producer.flush();
}

Compiling

In order to compile cppkafka you need:

  • librdkafka >= 0.9.4
  • CMake >= 3.9.2
  • A compiler with good C++11 support (e.g. gcc >= 4.8). This was tested successfully on g++ 4.8.3.
  • The boost library (for boost::optional)

Now, in order to build, just run:

mkdir build
cd build
cmake <OPTIONS> ..
make
make install

CMake options

The following cmake options can be specified:

  • RDKAFKA_ROOT : Specify a different librdkafka install directory.
  • RDKAFKA_DIR : Specify a different directory where the RdKafkaConfig.cmake is installed.
  • BOOST_ROOT : Specify a different Boost install directory.
  • CPPKAFKA_CMAKE_VERBOSE : Generate verbose output. Default is OFF.
  • CPPKAFKA_BUILD_SHARED : Build cppkafka as a shared library. Default is ON.
  • CPPKAFKA_DISABLE_TESTS : Disable build of cppkafka tests. Default is OFF.
  • CPPKAFKA_DISABLE_EXAMPLES : Disable build of cppkafka examples. Default is OFF.
  • CPPKAFKA_BOOST_STATIC_LIBS : Link with Boost static libraries. Default is ON.
  • CPPKAFKA_BOOST_USE_MULTITHREADED : Use Boost multi-threaded libraries. Default is ON.
  • CPPKAFKA_RDKAFKA_STATIC_LIB : Link to Rdkafka static library. Default is OFF.
  • CPPKAFKA_CONFIG_DIR : Install location of the cmake configuration files. Default is lib/cmake/cppkafka.
  • CPPKAFKA_PKGCONFIG_DIR : Install location of the .pc file. Default is share/pkgconfig.
  • CPPKAFKA_EXPORT_PKGCONFIG : Generate cppkafka.pc file. Default is ON.
  • CPPKAFKA_EXPORT_CMAKE_CONFIG : Generate CMake config, target and version files. Default is ON.

Example:

cmake -DRDKAFKA_ROOT=/some/other/dir -DCPPKAFKA_BUILD_SHARED=OFF ...

Using

If you want to use cppkafka, you'll need to link your application with:

  • cppkafka
  • rdkafka

If using CMake, this is simplified by doing:

find_package(CppKafka REQUIRED)

target_link_libraries(<YourLibrary> CppKafka::cppkafka)

Documentation

You can generate the documentation by running make docs inside the build directory. This requires Doxygen to be installed. The documentation will be written in html format at <build-dir>/docs/html/.

Make sure to check the wiki which includes some documentation about the project and some of its features.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].