lua-resty-kafka-fast

The repository of the binary installer

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

Upgrade OpenResty

If openresty has been previously installed, please execute the following upgrade command:

sudo yum upgrade -y openresty

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

Upgrade OpenResty

If openresty has been previously installed, please execute the following upgrade command:

sudo yum upgrade -y openresty

Installing OpenResty

Configure the openresty repo follow the document at 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 (C) 2024 OpenResty Inc. All rights reserved.

This software is proprietary and must not be redistributed or shared at all.