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

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

lireincore/kafka-rest-client
============================

Kafka rest client

11.3k3[1 issues](https://github.com/lireincore/kafka-rest-client/issues)PHP

Since May 21Pushed 5y agoCompare

[ Source](https://github.com/lireincore/kafka-rest-client)[ Packagist](https://packagist.org/packages/lireincore/kafka-rest-client)[ RSS](/packages/lireincore-kafka-rest-client/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Kafka rest client
=================

[](#kafka-rest-client)

[![Latest Stable Version](https://camo.githubusercontent.com/cefc269d16be1abde9daefe5bc55a56e0002ce0f9322f6f6a05b149f0d54f16a/68747470733a2f2f706f7365722e707567782e6f72672f6c697265696e636f72652f6b61666b612d726573742d636c69656e742f762f737461626c65)](https://packagist.org/packages/lireincore/kafka-rest-client)[![Total Downloads](https://camo.githubusercontent.com/ea2f32664f2f2c564ef1907ab3db228cc84801bcbb70f1624ce5e1f983f6de5c/68747470733a2f2f706f7365722e707567782e6f72672f6c697265696e636f72652f6b61666b612d726573742d636c69656e742f646f776e6c6f616473)](https://packagist.org/packages/lireincore/kafka-rest-client)[![License](https://camo.githubusercontent.com/47e6020c30d4b98cd24ffe29adad7270d74614ca7dc6df9929a57235d6c2892b/68747470733a2f2f706f7365722e707567782e6f72672f6c697265696e636f72652f6b61666b612d726573742d636c69656e742f6c6963656e7365)](https://packagist.org/packages/lireincore/kafka-rest-client)

About
-----

[](#about)

Kafka rest client for confluent rest proxy v2

Install
-------

[](#install)

Add the `"lireincore/kafka-rest-client": "dev-master"` package to your `require` section in the `composer.json` file

or

```
$ php composer.phar require lireincore/kafka-rest-client dev-master
```

Usage
-----

[](#usage)

```
use Psr\Log\LoggerInterface;
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\RequestFactoryInterface;
use LireinCore\KafkaRestClient\Client;
use LireinCore\KafkaRestClient\Producer;
use LireinCore\KafkaRestClient\Consumer;
use LireinCore\KafkaRestClient\KafkaRestException;
use LireinCore\KafkaRestClient\Request\SendMessagesRequest;
use LireinCore\KafkaRestClient\Request\ConsumerCreateRequest;
use LireinCore\KafkaRestClient\Request\ConsumerAssignmentRequest;
use LireinCore\KafkaRestClient\Request\GetMessagesRequest;

//$client implements Psr\Http\Client\ClientInterface
//$requestFactory implements Psr\Http\Message\RequestFactoryInterface
//$streamFactory implements Psr\Http\Message\StreamFactoryInterface
//$logger implements Psr\Log\LoggerInterface
$kafkaClient = new Client('rest-host:8082', $client, $requestFactory, $streamFactory, $logger);

//produce message
$producer = new Producer($kafkaClient);
$request = (new SendMessagesRequest('test_topic'))
    ->addRecord('test value');
$response = $producer->send($request);

/***************************************************************/
//consume message
$consumer = new Consumer($kafkaClient);
$consumerCreateRequest = new ConsumerCreateRequest('test_group');
$consumerCreateResponse = $consumer->create($consumerCreateRequest);

$consumerAssignmentRequest = (new ConsumerAssignmentRequest())
    ->addPartition('test_topic', 0);
$consumer->assign($consumerAssignmentRequest, $consumerCreateResponse);

$getMessagesRequest = new GetMessagesRequest();
$messages = $consumer->pool($getMessagesRequest, $consumerCreateResponse);

if ($messages) {
    //...custom process messages
    //commit last offsets
    $consumerCommitOffsetsRequest = $consumer->createConsumerCommitOffsetsRequest($messages);
    try {
        $consumer->commit($consumerCommitOffsetsRequest, $consumerCreateResponse);
    } catch (KafkaRestException $ex) {
        var_dump($ex->getMessage());
    }
}

$consumer->delete($consumerCreateResponse);
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80% 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/21308223?v=4)[lireincore](/maintainers/lireincore)[@lireincore](https://github.com/lireincore)

---

Top Contributors

[![sgworker](https://avatars.githubusercontent.com/u/20991976?v=4)](https://github.com/sgworker "sgworker (4 commits)")[![xaviered](https://avatars.githubusercontent.com/u/1844174?v=4)](https://github.com/xaviered "xaviered (1 commits)")

### Embed Badge

![Health badge](/badges/lireincore-kafka-rest-client/health.svg)

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

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