PHPackages                             zhizhong/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. [HTTP &amp; Networking](/categories/http)
4. /
5. zhizhong/kafka

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

zhizhong/kafka
==============

help to use kafka in laravel

08.3k↓100%PHP

Since Jun 26Pushed 6y agoCompare

[ Source](https://github.com/leon19910505/kafka)[ Packagist](https://packagist.org/packages/zhizhong/kafka)[ RSS](/packages/zhizhong-kafka/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Install
-------

[](#install)

```
composer require zhizhong/kafka:dev-master

```

Config
------

[](#config)

set kafka brokers routes in your env ,it can be a list by string

```
KAFKA_BROKERS=127.0.0.1:2086,127.0.0.2:2086

```

Usage
-----

[](#usage)

#### Producer

[](#producer)

the easy way to produce is use help function **kafka\_dispatch**

```
kafka_dispatch($topic, $msg)

```

> **Note:** $msg must be an array

#### Consumer

[](#consumer)

```
$consumer = new Consumer($topic);
while (true) {
    $msg = $consumer->consume();
    print_r($msg);
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/26701373?v=4)[leon19910505](/maintainers/leon19910505)[@leon19910505](https://github.com/leon19910505)

---

Top Contributors

[![leon19910505](https://avatars.githubusercontent.com/u/26701373?v=4)](https://github.com/leon19910505 "leon19910505 (2 commits)")

### Embed Badge

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

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

###  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)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

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

78126.4M414](/packages/react-http)

PHPackages © 2026

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