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)2792.4M↓15%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 1mo 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 93% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity61

Solid adoption and visibility

Community34

Small or concentrated contributor base

Maturity56

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

949d 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

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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