PHPackages                             longlang/phpkafka - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. longlang/phpkafka

ActiveLibrary[HTTP &amp; Networking](/categories/http)

longlang/phpkafka
=================

A kafka client. Support php-fpm and Swoole.

v1.2.5(2y ago)2802.6M—1.3%48[22 issues](https://github.com/swoole/phpkafka/issues)[7 PRs](https://github.com/swoole/phpkafka/pulls)12Apache-2.0PHPPHP &gt;=7.1

Since Nov 9Pushed 2y ago8 watchersCompare

[ Source](https://github.com/swoole/phpkafka)[ Packagist](https://packagist.org/packages/longlang/phpkafka)[ RSS](/packages/longlang-phpkafka/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (9)Versions (15)Used By (12)

longlang/phpkafka
=================

[](#longlangphpkafka)

[![Latest Version](https://camo.githubusercontent.com/7766d983734dd7a289203ac43cc765655ccb3f25edd7bb669da01942c4c33a38/68747470733a2f2f706f7365722e707567782e6f72672f6c6f6e676c616e672f7068706b61666b612f762f737461626c65)](https://packagist.org/packages/longlang/phpkafka)[![Php Version](https://camo.githubusercontent.com/315f5c30e505b9ccc4178451bbd34c2ba5d281d1fa3267304053ed19ab634125/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e312d627269676874677265656e2e737667)](https://secure.php.net/)[![License](https://camo.githubusercontent.com/34decf87d70b3a87b79c71fa01915bb9ef6c9553fca5c51b929b46e446787425/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c6f6e6779616e2f7068706b61666b612e737667)](https://github.com/longyan/phpkafka/blob/master/LICENSE)

Introduction
------------

[](#introduction)

English | [简体中文](README.cn.md)

PHP Kafka client is used in PHP-FPM and Swoole.

The communication protocol is based on the JSON file in Java. PHP Kafka client supports 50 APIs, which might be one that supports the most message types ever.

> The produce and the consume of messages are implemented. The component is in developing and testing.

Features
--------

[](#features)

- Support all 50 APIs
- Message compression
- PHP-FPM and Swoole compatible
- Producer
- Consumer
- SASL
- SSL
- More features and test cases

Environment
-----------

[](#environment)

- PHP &gt;= 7.1
- Kafka &gt;= 1.0.0
- Swoole &gt;= 4.5 (optional)

Installation
------------

[](#installation)

`composer require longlang/phpkafka`

Documentation and Examples
--------------------------

[](#documentation-and-examples)

- [Producer](doc/producer.en.md)
- [Consumer](doc/consumer.en.md)

Refer to `examples` for code examples.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity62

Solid adoption and visibility

Community34

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~82 days

Recently: every ~160 days

Total

14

Last Release

996d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f917bb42280d114c53cebadc2942a13ee03abe14971089f88895e266d637169?d=identicon)[Yurunsoft](/maintainers/Yurunsoft)

---

Top Contributors

[![Yurunsoft](https://avatars.githubusercontent.com/u/20104656?v=4)](https://github.com/Yurunsoft "Yurunsoft (89 commits)")[![limingxinleo](https://avatars.githubusercontent.com/u/16648551?v=4)](https://github.com/limingxinleo "limingxinleo (6 commits)")[![reneeteng](https://avatars.githubusercontent.com/u/16800727?v=4)](https://github.com/reneeteng "reneeteng (4 commits)")[![PandaLIU-1111](https://avatars.githubusercontent.com/u/26201936?v=4)](https://github.com/PandaLIU-1111 "PandaLIU-1111 (4 commits)")[![leocavalcante](https://avatars.githubusercontent.com/u/183722?v=4)](https://github.com/leocavalcante "leocavalcante (3 commits)")[![qiqizjl](https://avatars.githubusercontent.com/u/7540584?v=4)](https://github.com/qiqizjl "qiqizjl (2 commits)")[![huangdijia](https://avatars.githubusercontent.com/u/8337659?v=4)](https://github.com/huangdijia "huangdijia (2 commits)")[![Reasno](https://avatars.githubusercontent.com/u/3881629?v=4)](https://github.com/Reasno "Reasno (1 commits)")[![sy-records](https://avatars.githubusercontent.com/u/33931153?v=4)](https://github.com/sy-records "sy-records (1 commits)")[![szutoutou](https://avatars.githubusercontent.com/u/17758819?v=4)](https://github.com/szutoutou "szutoutou (1 commits)")[![dygin](https://avatars.githubusercontent.com/u/72969862?v=4)](https://github.com/dygin "dygin (1 commits)")

---

Tags

kafkaphpswoole

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/longlang-phpkafka/health.svg)

```
[![Health](https://phpackages.com/badges/longlang-phpkafka/health.svg)](https://phpackages.com/packages/longlang-phpkafka)
```

###  Alternatives

[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.5k196.2M3.1k](/packages/composer-composer)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.3k](/packages/friendsofphp-php-cs-fixer)[getgrav/grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS

15.6k86.4k1](/packages/getgrav-grav)[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2603.2M436](/packages/ssch-typo3-rector)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
