PHPackages                             liangbc/kafka - 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. liangbc/kafka

ActiveLibrary

liangbc/kafka
=============

Based on rdkafka, kafka advanced consumers, low-level consumers and producers

v1.1.0(5y ago)213MITPHPPHP &gt;=5.6

Since Aug 4Pushed 5y ago1 watchersCompare

[ Source](https://github.com/liangbc-space/kafka)[ Packagist](https://packagist.org/packages/liangbc/kafka)[ RSS](/packages/liangbc-kafka/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

kafka
=====

[](#kafka)

Based on rdkafka, kafka advanced consumers, low-level consumers and producers

installation
============

[](#installation)

```
composer require liangbc\kafka

```

example
=======

[](#example)

- 消费者

```
//  Initialize kafkaConsume configuration
$consumerConfig = new \kafka\ConsumeConfig('127.0.0.1:9902,127.0.0.1:9903');

//  Create low-level consumer instance
//$consumer = new \kafka\LowConsumer($kafkaConfig);

//  Create high-level consumer instance
$consumer = new \kafka\SeniorConsumer($consumerConfig);

//  Manually submit the offset
//$consumer->autoCommit = true;

//  自动提交超时自动提交时间，毫秒
//$consumer->autoCommitIntervalMs = 5 * 1000;

//  Consumer subscription message
$consumer->consumer(['topic1', 'topic2'], function (\RdKafka\Message $message, \RdKafka\KafkaConsumer $consumer) {
    var_dump($message->payload);

    //  Manually submit the offset
    $consumer->commit();
});

```

- 生产者

```
//  Initialize kafkaProduce configuration
$produceConfig = new \kafka\ProduceConfig('127.0.0.1:9902,127.0.0.1:9903');

//  Create producer instance
$producer = new \kafka\Producer($produceConfig);

//  Production news
$producer->producer('topic', 'message', 1);

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2111d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e5405baf2801065985ffc573039df838036daaba7fe4ae1cbc9802e4b47c514?d=identicon)[梁彬城](/maintainers/%E6%A2%81%E5%BD%AC%E5%9F%8E)

---

Top Contributors

[![liangbc-space](https://avatars.githubusercontent.com/u/20675308?v=4)](https://github.com/liangbc-space "liangbc-space (5 commits)")

### Embed Badge

![Health badge](/badges/liangbc-kafka/health.svg)

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

PHPackages © 2026

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