cppkafka/0.4.1

Modern C++ Apache Kafka client library (wrapper for librdkafka)
Recipe info
2024-01-26

Available packages
Linux
Windows
macOS
macOS Apple Silicon

Install
Add the following line to your conanfile.txt:
[requires]
cppkafka/0.4.1

Using cppkafka

Note

If you are a new Conan user, we recommend reading the how to consume packages tutorial.

If you need additional assistance, please ask a question in the Conan Center Index repository.

Simplest use case consuming this recipe and assuming CMake as your local build tool:

[requires]
cppkafka/0.4.1
[generators]
CMakeDeps
CMakeToolchain
[layout]
cmake_layout
from conan import ConanFile
from conan.tools.cmake import cmake_layout


class ExampleRecipe(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeDeps", "CMakeToolchain"

    def requirements(self):
        self.requires("cppkafka/0.4.1")

    def layout(self):
        cmake_layout(self)

Now, you can run this Conan command to locally install (and build if necessary) this recipe and its dependencies (if any):

$ conan install conanfile.txt --build=missing

Useful information to take into account to consume this library:


These are the main declared targets:

  • CMake package name(s): CppKafka
  • CMake target name(s): CppKafka::cppkafka
  • _cppkafka => CppKafka::cppkafka
    
  • pkg-config file name(s): cppkafka.pc
  • _cppkafka => cppkafka.pc
    

A simple use case using the CMake file name and the global target:

# ...
find_package(CppKafka REQUIRED)
# ...
target_link_libraries(YOUR_TARGET CppKafka::cppkafka)

These are all the available headers. Some of these ones might be non-public; make sure of it by visiting the cppkafka homepage listed above:

#include "cppkafka/buffer.h"
#include "cppkafka/clonable_ptr.h"
#include "cppkafka/configuration.h"
#include "cppkafka/configuration_base.h"
#include "cppkafka/configuration_option.h"
#include "cppkafka/consumer.h"
#include "cppkafka/cppkafka.h"
#include "cppkafka/detail/callback_invoker.h"
#include "cppkafka/detail/endianness.h"
#include "cppkafka/error.h"
#include "cppkafka/event.h"
#include "cppkafka/exceptions.h"
#include "cppkafka/group_information.h"
#include "cppkafka/header.h"
#include "cppkafka/header_list.h"
#include "cppkafka/header_list_iterator.h"
#include "cppkafka/kafka_handle_base.h"
#include "cppkafka/logging.h"
#include "cppkafka/macros.h"
#include "cppkafka/message.h"
#include "cppkafka/message_builder.h"
#include "cppkafka/message_internal.h"
#include "cppkafka/message_timestamp.h"
#include "cppkafka/metadata.h"
#include "cppkafka/producer.h"
#include "cppkafka/queue.h"
#include "cppkafka/topic.h"
#include "cppkafka/topic_configuration.h"
#include "cppkafka/topic_partition.h"
#include "cppkafka/topic_partition_list.h"
#include "cppkafka/utils/backoff_committer.h"
#include "cppkafka/utils/backoff_performer.h"
#include "cppkafka/utils/buffered_producer.h"
#include "cppkafka/utils/compacted_topic_processor.h"
#include "cppkafka/utils/consumer_dispatcher.h"
#include "cppkafka/utils/poll_interface.h"
#include "cppkafka/utils/poll_strategy_base.h"
#include "cppkafka/utils/roundrobin_poll_strategy.h"