{"id":20231006,"url":"https://github.com/bewaremypower/kafka-client","last_synced_at":"2026-06-11T07:31:23.420Z","repository":{"id":109020257,"uuid":"141915882","full_name":"BewareMyPower/kafka-client","owner":"BewareMyPower","description":"some encapsulation when use librdkafka","archived":false,"fork":false,"pushed_at":"2019-11-28T06:22:15.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T13:45:28.435Z","etag":null,"topics":["cpp11","librdkafka"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BewareMyPower.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2018-07-22T17:18:35.000Z","updated_at":"2019-11-28T06:22:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"58efa18f-aa83-4e95-867e-e62580cbb210","html_url":"https://github.com/BewareMyPower/kafka-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BewareMyPower/kafka-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BewareMyPower%2Fkafka-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BewareMyPower%2Fkafka-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BewareMyPower%2Fkafka-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BewareMyPower%2Fkafka-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BewareMyPower","download_url":"https://codeload.github.com/BewareMyPower/kafka-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BewareMyPower%2Fkafka-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34188272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cpp11","librdkafka"],"created_at":"2024-11-14T07:44:49.871Z","updated_at":"2026-06-11T07:31:23.398Z","avatar_url":"https://github.com/BewareMyPower.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## rdkafka-client\n\nSimple and lightweight Linux C++11 encapsulation on [librdkafka](https://github.com/edenhill/librdkafka)'s C API.\n\n1. Use `std::unique_ptr\u003cT\u003e` to manage pointers like `rd_kafka_t*`;\n2. Use a simple config format. (I've tried TOML but found it unnecessary);\n3. Use variadic template to implement formatted error handle functions.\n\n## Why not use [cppkafka](https://github.com/mfontanini/cppkafka)\n\n1. Just for C++11 practice;\n2. Not require boost library.\n\nI've only encapsulated some necessary functions to use, it's easy to extend these header files for your own use.\n\n## How to use\n\nIt's a header-only library and there's a sample Makefile, but `ROOT_RDKAFKA` should be modified to *librdkafka*'s root directory.\nFirst open [Makefile](examples/Makefile) and modify `ROOT_RDKAFKA` to your librdkafka install directory.\n\n```\ncd examples\nmake\n```\n\nBefore run example programs, ensure that your path of `librdkafka.so` has been added to `LD_LIBRARY_PATH`.\n\n```\n$ ./producer \nUsage: ./producer \u003ctopic-name\u003e [config-path]\n$ ./consumer \nUsage: ./consumer \u003ctopic-name\u003e [config-path]\n```\n\nLog is written to stderr, so you can redirect stderr to file (eg. `2\u003etest.log`) to watch message in terminal and check for log later.\n\n## NOTE\n\nold version kafka must add these global configure(my kafka version is 0.9.0.1), see [Broker version compatibility](https://github.com/edenhill/librdkafka/wiki/Broker-version-compatibility)\n\n```\napi.version.request=false\nbroker.version.fallback=0.9.0.1\n```\n\nI've struggled with this problem for a while, it's really important to learn how [Kafka](https://kafka.apache.org/documentation.html) works and read [librdkafka WIKI](https://github.com/edenhill/librdkafka/wiki) first.\n\n## REFACTOR\n\nOld version SDK in `rdkafka_*.hpp` is a mess, so I've started to write a new SDK in `include/kafka_client` and write some tests in `tests`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbewaremypower%2Fkafka-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbewaremypower%2Fkafka-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbewaremypower%2Fkafka-client/lists"}