PHPackages                             ensi/laravel-phprdkafka-producer - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ensi/laravel-phprdkafka-producer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ensi/laravel-phprdkafka-producer
================================

Opiniated High Level producer for laravel-phprdkafka

0.4.5(5mo ago)373.5k↓54.9%3MITPHPPHP ^8.1CI passing

Since Oct 1Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/ensi-platform/laravel-php-rdkafka-producer)[ Packagist](https://packagist.org/packages/ensi/laravel-phprdkafka-producer)[ RSS](/packages/ensi-laravel-phprdkafka-producer/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (10)Versions (17)Used By (0)

Laravel PHP Rdkafka Producer
============================

[](#laravel-php-rdkafka-producer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4854696b3b50bb5c898e0e460836788f28efa7433e98e8cec3659d41ef1333a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656e73692f6c61726176656c2d70687072646b61666b612d70726f64756365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ensi/laravel-phprdkafka-producer)[![Tests](https://github.com/ensi-platform/laravel-php-rdkafka/actions/workflows/run-tests.yml/badge.svg?branch=master)](https://github.com/ensi-platform/laravel-php-rdkafka/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/e247fe047c68a759796b7cc16ab46b43b0eeaceb356fbd30e8f5ac1acd9fe9de/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656e73692f6c61726176656c2d70687072646b61666b612d70726f64756365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ensi/laravel-phprdkafka-producer)

Opiniated High Level producer for [ensi/laravel-phprdkafka](https://github.com/ensi-platform/laravel-php-rdkafka)

Installation
------------

[](#installation)

Firstly, you have to install and configure [ensi/laravel-phprdkafka](https://github.com/ensi-platform/laravel-php-rdkafka)

Then,

```
composer require ensi/laravel-phprdkafka-producer
```

Publish the config file if you need it:

```
php artisan vendor:publish --provider="Ensi\LaravelPhpRdKafkaProducer\LaravelPhpRdKafkaProducerServiceProvider" --tag="kafka-producer-config"
```

Version Compatibility
---------------------

[](#version-compatibility)

Laravel rdkakfa-producerLaravelPHPensi/laravel-phprdkafka^0.1.0^7.x || ^8.x^8.0^0.1.4^0.2.0^7.x || ^8.x^8.0^0.1.4^0.2.1^7.x || ^8.x^8.0^0.2^0.2.3^8.x || ^9.x^8.0^0.2^0.3.0^8.x || ^9.x^8.0^0.3.0^0.3.2^8.x || ^9.x || ^10.x^8.0^0.3.0^0.3.3^8.x || ^9.x || ^10.x || ^11.x^8.0^0.3.4^0.4.0^9.x || ^10.x || ^11.x^8.1^0.4.0^0.4.4^9.x || ^10.x || ^11.x || ^12.x^8.1^0.4.5Basic Usage
-----------

[](#basic-usage)

Send a single message:

```
use Ensi\LaravelPhpRdKafkaProducer\HighLevelProducer;

(new HighLevelProducer($topicKey))->sendOne($messageString);
```

Send several messages at once:

```
(new HighLevelProducer($topicKey))->sendMany([$message1String, $message2String]);
```

All options with defaults:

```
use Ensi\LaravelPhpRdKafkaProducer\HighLevelProducer;
use Ensi\LaravelPhpRdKafkaProducer\Exceptions\KafkaProducerException;

$producer = new HighLevelProducer(
    topicKey: $topicKey,
    producerName: 'some-producer-from-ensi/laravel-phprdkafka-config',
    flushTimeout: 5000, // ms
    flushRetries: 5,
);

try {
    $producer
        ->setFlushTimeout(10000)
        ->setFlushRetries(10)
        ->sendOne($messageString);
} catch (KafkaProducerException $e) {
    //...
}
```

### Middleware

[](#middleware)

You can add middleware globally via config or locally for specific Producer:

```
$producer->pushMiddleware(SomeMiddleware::class)
        ->sendOne($messageString);
```

Middleware example:

```
use Closure;
use Ensi\LaravelPhpRdKafkaProducer\ProducerMessage;

class SomeMiddleware
{
    public function handle(ProducerMessage $message, Closure $next): mixed
    {
        $message->headers = $message->headers ?: [];
        $message->headers['Header-Name'] = 'Header Value';

        return $next($message);
    }
}
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

### Testing

[](#testing)

1. composer install
2. composer test

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](.github/SECURITY.md) on how to report security vulnerabilities.

License
-------

[](#license)

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

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance72

Regular maintenance activity

Popularity36

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.5% 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 ~112 days

Recently: every ~86 days

Total

15

Last Release

161d ago

PHP version history (2 changes)0.1.0PHP ^8.0

0.4.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8089373?v=4)[Наталия](/maintainers/MsNatali)[@MsNatali](https://github.com/MsNatali)

![](https://avatars.githubusercontent.com/u/7352966?v=4)[Andrey](/maintainers/dimionx)[@DimionX](https://github.com/DimionX)

---

Top Contributors

[![MsNatali](https://avatars.githubusercontent.com/u/8089373?v=4)](https://github.com/MsNatali "MsNatali (23 commits)")[![arrilot](https://avatars.githubusercontent.com/u/2826480?v=4)](https://github.com/arrilot "arrilot (5 commits)")[![C0rTeZ13](https://avatars.githubusercontent.com/u/120840631?v=4)](https://github.com/C0rTeZ13 "C0rTeZ13 (3 commits)")[![valerialukinykh](https://avatars.githubusercontent.com/u/123940772?v=4)](https://github.com/valerialukinykh "valerialukinykh (2 commits)")[![DimionX](https://avatars.githubusercontent.com/u/7352966?v=4)](https://github.com/DimionX "DimionX (2 commits)")[![MadridianFox](https://avatars.githubusercontent.com/u/3392587?v=4)](https://github.com/MadridianFox "MadridianFox (2 commits)")[![zix2](https://avatars.githubusercontent.com/u/51262118?v=4)](https://github.com/zix2 "zix2 (1 commits)")[![eugene-holiday](https://avatars.githubusercontent.com/u/1556306?v=4)](https://github.com/eugene-holiday "eugene-holiday (1 commits)")[![amlagoda](https://avatars.githubusercontent.com/u/49432167?v=4)](https://github.com/amlagoda "amlagoda (1 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ensi-laravel-phprdkafka-producer/health.svg)

```
[![Health](https://phpackages.com/badges/ensi-laravel-phprdkafka-producer/health.svg)](https://phpackages.com/packages/ensi-laravel-phprdkafka-producer)
```

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

592.7k2](/packages/crumbls-layup)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1320.9k4](/packages/team-nifty-gmbh-tall-datatables)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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