lua-resty-kafka-fast
Prerequisites
The use must have the root permission.
The machine needs to be able to access the following domains to download packages and GPG keys:
You can check the accessibility of the domains by running the following commands:
curl https://openresty.org/package/pubkey.gpg curl https://pkg2.openresty.com/xray-priv-libs/
Configure the software repository
First, we need to configure the repository of the binary installer using the commands below. (The CLIENT_TOKEN in the commands needs to be replaced with a valid Token from the subscription email)
curl -o get-xray-priv-lib-repo.sh https://pkg2.openresty.com/scripts/get-xray-priv-lib-repo.sh
sudo bash get-xray-priv-lib-repo.sh -l openresty-priv-comm -t CLIENT_TOKEN
sudo bash get-xray-priv-lib-repo.sh -l lua-resty-kafka-fast -t CLIENT_TOKEN
We also rely on Openresty’s open-source repositories in addition to the above-mentioned repository. If you have not previously configured the open-source repository, you can refer to this page for configurations.
Installation
For OpenResty-1.21.4.x
For CentOS/RockyLinux/Amazon Linux/Alibaba Cloud Linux/Tecent Linux operating systems using yum as the package manager, execute the following command to install the private libraries.
sudo yum makecache
sudo yum install --disablerepo="*" --enablerepo=lua-resty-kafka-fast --enablerepo=openresty-priv-comm -y lua-kafka-nginx-module-1.21.4
For operating systems such as Fedora that use dnf as package manager, execute the following command to install the private library.
sudo dnf makecache
sudo dnf install --disablerepo="*" --enablerepo=lua-resty-kafka-fast --enablerepo=openresty-priv-comm -y lua-kafka-nginx-module-1.21.4
For operating systems such as Ubuntu/Debian that use apt as the package manager, run the following command to install the private libraries.
sudo apt-get install -y lua-kafka-nginx-module-1.21.4
For OpenResty 1.25.3.x
For CentOS/RockyLinux/Amazon Linux/Alibaba Cloud Linux/Tecent Linux operating systems using yum as the package manager, execute the following command to install the private libraries.
sudo yum makecache
sudo yum install --disablerepo="*" --enablerepo=lua-resty-kafka-fast --enablerepo=openresty-priv-comm -y lua-kafka-nginx-module-1.25.3
For operating systems such as Fedora that use dnf as package manager, execute the following command to install the private library.
sudo dnf makecache
sudo dnf install --disablerepo="*" --enablerepo=lua-resty-kafka-fast --enablerepo=openresty-priv-comm -y lua-kafka-nginx-module-1.25.3
For operating systems such as Ubuntu/Debian that use apt as the package manager, run the following command to install the private libraries.
sudo apt-get install -y lua-kafka-nginx-module-1.25.3
For OpenResty 1.27.1.x
For CentOS/RockyLinux/Amazon Linux/Alibaba Cloud Linux/Tecent Linux operating systems using yum as the package manager, execute the following command to install the private libraries.
sudo yum makecache
sudo yum install --disablerepo="*" --enablerepo=lua-resty-kafka-fast --enablerepo=openresty-priv-comm -y lua-kafka-nginx-module-1.27.1
For operating systems such as Fedora that use dnf as package manager, execute the following command to install the private library.
sudo dnf makecache
sudo dnf install --disablerepo="*" --enablerepo=lua-resty-kafka-fast --enablerepo=openresty-priv-comm -y lua-kafka-nginx-module-1.27.1
For operating systems such as Ubuntu/Debian that use apt as the package manager, run the following command to install the private libraries.
sudo apt-get install -y lua-kafka-nginx-module-1.27.1
For OpenResty 1.31.8.x
For systems using the yum package manager, run the following commands to install the private library:
sudo yum makecache
sudo yum install --disablerepo="*" --enablerepo=lua-resty-kafka-fast --enablerepo=openresty-priv-comm -y lua-kafka-nginx-module-1.31.8
For systems using the dnf package manager, run the following commands to install the private library:
sudo dnf makecache
sudo dnf install --disablerepo="*" --enablerepo=lua-resty-kafka-fast --enablerepo=openresty-priv-comm -y lua-kafka-nginx-module-1.31.8
For systems using the apt package manager, run the following commands to install the private library:
sudo apt-get update
sudo apt-get install -y lua-kafka-nginx-module-1.31.8
Installing OpenResty
When installing or upgrading OpenResty, first query the available versions and install the version that matches the selected private library. Avoid upgrading directly to the latest repository version, which may be incompatible with the installed dynamic modules.
Configure the OpenResty repository as described in https://openresty.org/en/linux-packages.html.
For example, on systems using yum as the package manager, to install OpenResty 1.25.3:
$ yum list --showduplicates openresty
Last metadata expiration check: 0:07:22 ago on Sat 13 Sep 2025 07:15:05 AM CST.
Available Packages
openresty.x86_64 1.21.4.4-1.el9 openresty
openresty.x86_64 1.25.3.2-1.el9 openresty
openresty.x86_64 1.27.1.2-1.el9 openresty
$ sudo yum install openresty-1.25.3.2-1.el9
For example, on systems using dnf as the package manager, to install OpenResty 1.25.3:
$ dnf list --showduplicates openresty
Last metadata expiration check: 0:07:22 ago on Sat 13 Sep 2025 07:15:05 AM CST.
Available Packages
openresty.x86_64 1.21.4.4-1.el9 openresty
openresty.x86_64 1.25.3.2-1.el9 openresty
openresty.x86_64 1.27.1.2-1.el9 openresty
$ sudo dnf install openresty-1.25.3.2-1.el9
For systems using apt as the package manager, to install OpenResty 1.25.3:
$ apt-cache madison openresty
openresty | 1.27.1.2-1~noble1 | https://openresty.org/package/ubuntu noble/main amd64 Packages
openresty | 1.27.1.1-1~noble1 | https://openresty.org/package/ubuntu noble/main amd64 Packages
openresty | 1.25.3.2-2~noble1 | https://openresty.org/package/ubuntu noble/main amd64 Packages
$ sudo apt install openresty=1.25.3.2-2~noble1
Usage
Go to lua-resty-kafka-fast for more details.
Benchmark
On an Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz, each worker can consume 40,000 messages per second.
Copyright & Licenses
Copyright (C) 2024 OpenResty Inc. All rights reserved.
This software is proprietary and must not be redistributed or shared at all.