{"id":27940773,"url":"https://github.com/telecominfraproject/wlan-cloud-lib-cppkafka","last_synced_at":"2025-05-07T10:20:57.858Z","repository":{"id":229081417,"uuid":"726212574","full_name":"Telecominfraproject/wlan-cloud-lib-cppkafka","owner":"Telecominfraproject","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-01T17:55:42.000Z","size":682,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-17T01:03:24.499Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Telecominfraproject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-12-01T19:25:21.000Z","updated_at":"2024-03-01T17:56:10.000Z","dependencies_parsed_at":"2024-03-22T00:10:32.648Z","dependency_job_id":"29dc9500-a6af-4976-a195-ca5f30c970bf","html_url":"https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka","commit_stats":null,"previous_names":["telecominfraproject/wlan-cloud-lib-cppkafka"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telecominfraproject%2Fwlan-cloud-lib-cppkafka","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telecominfraproject%2Fwlan-cloud-lib-cppkafka/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telecominfraproject%2Fwlan-cloud-lib-cppkafka/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telecominfraproject%2Fwlan-cloud-lib-cppkafka/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Telecominfraproject","download_url":"https://codeload.github.com/Telecominfraproject/wlan-cloud-lib-cppkafka/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252856815,"owners_count":21814904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-07T10:20:57.215Z","updated_at":"2025-05-07T10:20:57.818Z","avatar_url":"https://github.com/Telecominfraproject.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cppkafka: high level C++ wrapper for _rdkafka_\n\n[![Build status](https://travis-ci.org/mfontanini/cppkafka.svg?branch=master)](https://travis-ci.org/mfontanini/cppkafka) \n\n_cppkafka_ allows C++ applications to consume and produce messages using the Apache Kafka\nprotocol. The library is built on top of [_librdkafka_](https://github.com/edenhill/librdkafka), \nand provides a high level API that uses modern C++ features to make it easier to write code\nwhile keeping the wrapper's performance overhead to a minimum.\n\n# Features\n\n* _cppkafka_ is a high level C++ wrapper for _rdkafka_, aiming to allow using _rdkafka_ in a \nsimple, less error prone way. \n\n* _cppkafka_ provides an API to produce messages as well as consuming messages, but the latter is \nonly supported via the high level consumer API. _cppkafka_ requires **rdkafka \u003e= 0.9.4** in \norder to use it. Other wrapped functionalities are also provided, like fetching metadata, \noffsets, etc.\n\n* _cppkafka_ provides message header support. This feature requires **rdkafka \u003e= 0.11.4**.\n\n* _cppkafka_ tries to add minimal overhead over _librdkafka_. A very thin wrapper for _librdkafka_\nmessages is used for consumption so there's virtually no overhead at all.\n\n# It's simple!\n\n_cppkafka_'s API is simple to use. For example, this code creates a producer that writes a message\ninto some partition:\n\n```c++\n#include \u003ccppkafka/cppkafka.h\u003e\n\nusing namespace std;\nusing namespace cppkafka;\n\nint main() {\n    // Create the config\n    Configuration config = {\n        { \"metadata.broker.list\", \"127.0.0.1:9092\" }\n    };\n\n    // Create the producer\n    Producer producer(config);\n\n    // Produce a message!\n    string message = \"hey there!\";\n    producer.produce(MessageBuilder(\"my_topic\").partition(0).payload(message));\n    producer.flush();\n}\n```\n\n# Compiling\n\nIn order to compile _cppkafka_ you need:\n\n* _librdkafka \u003e= 0.9.4_\n* _CMake \u003e= 3.9.2_\n* A compiler with good C++11 support (e.g. gcc \u003e= 4.8). This was tested successfully on _g++ 4.8.3_. \n* The boost library (for boost::optional)\n\nNow, in order to build, just run:\n\n```Shell\nmkdir build\ncd build\ncmake \u003cOPTIONS\u003e ..\nmake\nmake install\n```\n\n## CMake options\n\nThe following cmake options can be specified:\n* `RDKAFKA_ROOT` : Specify a different librdkafka install directory.\n* `RDKAFKA_DIR` : Specify a different directory where the RdKafkaConfig.cmake is installed.\n* `BOOST_ROOT` : Specify a different Boost install directory.\n* `CPPKAFKA_CMAKE_VERBOSE` : Generate verbose output. Default is `OFF`.\n* `CPPKAFKA_BUILD_SHARED` : Build cppkafka as a shared library. Default is `ON`.\n* `CPPKAFKA_DISABLE_TESTS` : Disable build of cppkafka tests. Default is  `OFF`.\n* `CPPKAFKA_DISABLE_EXAMPLES` : Disable build of cppkafka examples. Default is `OFF`.\n* `CPPKAFKA_BOOST_STATIC_LIBS` : Link with Boost static libraries. Default is `ON`.\n* `CPPKAFKA_BOOST_USE_MULTITHREADED` : Use Boost multi-threaded libraries. Default is `ON`.\n* `CPPKAFKA_RDKAFKA_STATIC_LIB` : Link to Rdkafka static library. Default is `OFF`.\n* `CPPKAFKA_CONFIG_DIR` : Install location of the cmake configuration files. Default is `lib/cmake/cppkafka`.\n* `CPPKAFKA_PKGCONFIG_DIR` : Install location of the .pc file. Default is `share/pkgconfig`.\n* `CPPKAFKA_EXPORT_PKGCONFIG` : Generate `cppkafka.pc` file. Default is `ON`.\n* `CPPKAFKA_EXPORT_CMAKE_CONFIG` : Generate CMake config, target and version files. Default is `ON`.\n\nExample:\n```Shell\ncmake -DRDKAFKA_ROOT=/some/other/dir -DCPPKAFKA_BUILD_SHARED=OFF ...\n```\n\n# Using\n\nIf you want to use _cppkafka_, you'll need to link your application with:\n\n* _cppkafka_\n* _rdkafka_\n\nIf using CMake, this is simplified by doing:\n```cmake\nfind_package(CppKafka REQUIRED)\n\ntarget_link_libraries(\u003cYourLibrary\u003e CppKafka::cppkafka)\n```\n\n# Documentation\n\nYou can generate the documentation by running `make docs` inside the build directory. This requires\n_Doxygen_ to be installed. The documentation will be written in html format at\n`\u003cbuild-dir\u003e/docs/html/`.\n\nMake sure to check the [wiki](https://github.com/mfontanini/cppkafka/wiki) which includes\nsome documentation about the project and some of its features.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelecominfraproject%2Fwlan-cloud-lib-cppkafka","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelecominfraproject%2Fwlan-cloud-lib-cppkafka","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelecominfraproject%2Fwlan-cloud-lib-cppkafka/lists"}