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

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

beta/kafka.client
=================

Kafka client

1.0.3(1y ago)0791MITPHPPHP &gt;=7.4

Since Jan 25Pushed 1y ago2 watchersCompare

[ Source](https://github.com/beta-eto-code/kafka.client)[ Packagist](https://packagist.org/packages/beta/kafka.client)[ RSS](/packages/beta-kafkaclient/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (1)

Клиент для работы с брокером сообщений Kafka
============================================

[](#клиент-для-работы-с-брокером-сообщений-kafka)

Установка
---------

[](#установка)

```
composer require beta/kafka.client
```

Consumer пример работы
----------------------

[](#consumer-пример-работы)

```
use RdKafka\Conf;
use RdKafka\Consumer;
use RdKafka\TopicConf;
use KafkaClient\Client;

$consumerConfig = new Conf();
$consumerConfig->set('group.id', 'myConsumerGroup'); // устанавливаем идентификатор группы потребителей сообщений
$consumerConfig->set('enable.partition.eof', 'true');

$consumer = new Consumer($consumerConfig);
$consumer->addBrokers("172.0.0.1,172.0.0.2"); // указываем адреса для подключения к брокерам сообщений

$topicConfig = new TopicConf();
$topicConfig->set('auto.commit.interval.ms', 100);
$topicConfig->set('offset.store.method', 'broker'); // механизм для хранения курсора
$topicConfig->set('auto.offset.reset', 'earliest'); // курсор по-умолчанию

$client = Client::initAsConsumer($consumer, $topicConfig);
$message = $client->getMessage(
    'my_topic',
    [
        'partition' => 0,
        'offset' => 2,
        'timeout' => 2000
    ]
); // запрашиваем 1 сообщение из брокера
$message->getData(); // payload сообщения
$message->getOriginal(); // оригинальное сообщение RdKafka

/**
* Перебираем новые сообщения из брокера
**/
foreach ($client->getMessageIterator('my_topic') as $message) {
    echo $message->getData();
}
```

Producer пример работы
----------------------

[](#producer-пример-работы)

```
use RdKafka\Conf;
use RdKafka\Producer;
use RdKafka\TopicConf;
use KafkaClient\Client;

$producerConfig = new Conf();
$producerConfig->set('log_level', (string) LOG_DEBUG); // режим ведения логов
$producerConfig->set('debug', 'all');

$producer = new Producer($producerConfig);
$producer->addBrokers("172.0.0.1,172.0.0.2"); // указываем адреса для подключения к брокерам сообщений

$client = Client::initAsProducer($producer);
$client->sendMessage(
    'Test message',
    'my_topic',
    [
        'partition' => 0,
        'key' => 'example',
        'headers' => ['One' => 'Two']
    ]
);
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity45

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

Every ~91 days

Total

4

Last Release

569d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c75fd54c926c6b835a6b6cd92514d60d55a285d35847b9f22aefcc7ad5ef9ae7?d=identicon)[nnagornyy](/maintainers/nnagornyy)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/beta-kafkaclient/health.svg)

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

###  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)
