{"id":21970815,"url":"https://github.com/kingluo/lua-resty-ffi-kafka","last_synced_at":"2026-05-05T09:32:13.822Z","repository":{"id":185026105,"uuid":"606763291","full_name":"kingluo/lua-resty-ffi-kafka","owner":"kingluo","description":"The openresty kafka client library that encapsulates kafka-go","archived":false,"fork":false,"pushed_at":"2023-02-26T15:19:11.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-18T18:03:59.239Z","etag":null,"topics":["coroutines","kafka","luajit","nginx","openresty"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kingluo.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}},"created_at":"2023-02-26T13:53:47.000Z","updated_at":"2023-03-10T10:46:03.000Z","dependencies_parsed_at":"2023-07-31T12:49:48.537Z","dependency_job_id":null,"html_url":"https://github.com/kingluo/lua-resty-ffi-kafka","commit_stats":null,"previous_names":["kingluo/lua-resty-ffi-kafka"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kingluo/lua-resty-ffi-kafka","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingluo%2Flua-resty-ffi-kafka","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingluo%2Flua-resty-ffi-kafka/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingluo%2Flua-resty-ffi-kafka/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingluo%2Flua-resty-ffi-kafka/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kingluo","download_url":"https://codeload.github.com/kingluo/lua-resty-ffi-kafka/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingluo%2Flua-resty-ffi-kafka/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32643589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"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":["coroutines","kafka","luajit","nginx","openresty"],"created_at":"2024-11-29T14:43:12.798Z","updated_at":"2026-05-05T09:32:13.793Z","avatar_url":"https://github.com/kingluo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lua-resty-ffi-kafka\nThe openresty kafka client library that encapsulates kafka-go\n\n## Quickstart\n\n[Install lua-resty-ffi first.](https://github.com/kingluo/lua-resty-ffi#install-lua-resty-ffi-via-luarocks)\n\n```bash\n# download and build\ncd /opt\ngit clone https://github.com/kingluo/lua-resty-ffi-kafka\ncd lua-resty-ffi-kafka\nmake\n\n# start kafka container\ncd demo\ndocker compose up -d\n\n# create topic\npython3 create-topic.py\n\n# start nginx\nmkdir logs\nLD_LIBRARY_PATH=/opt/lua-resty-ffi-kafka/:/usr/local/lib/lua/5.1 \\\nnginx -p $PWD -c nginx.conf\n\n# test sync send\ncurl http://localhsot:20000/send?cnt=1\n```\n\n## Background\n\n[lua-resty-kafka](https://github.com/doujiang24/lua-resty-kafka) has below issues:\n\n* the author does not maintain the project positively anymore\n* features missing\n  * kafka version compatibility\n  * compression\n  * consumer group\n  * reconnections\n  * more SASL methods\n  * ...\n* bugs\n  * no necessary metadata refresh ahead of send/receive\n  * code reentrancy problem (e.g. concurrent sync sends)\n  * ...\n\n[kafka-go](https://github.com/segmentio/kafka-go) is a popular and active kafka client library.\n\nWhy not encapsulate it so that we could reuse it in openresty?\n\n[lua-resty-ffi](https://github.com/kingluo/lua-resty-ffi) provides an efficient and generic API to do hybrid programming\nin openresty with mainstream languages (Go, Python, Java, Rust, Nodejs).\n\n`lua-resty-ffi-kafka = lua-resty-ffi + kafka-go`\n\n## Benchmark\n\n![lua-resty-ffi-kafka vs lua-resty-kafka](benchmark.png)\n\nFor the time being, lua-resty-ffi-kafka is 80% of the performance of lua-resty-kafka.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingluo%2Flua-resty-ffi-kafka","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkingluo%2Flua-resty-ffi-kafka","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingluo%2Flua-resty-ffi-kafka/lists"}