PHPackages                             greensight/laravel-phprdkafka-consumer - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. greensight/laravel-phprdkafka-consumer

Abandoned → [ensi/laravel-phprdkafka-consumer](/?search=ensi%2Flaravel-phprdkafka-consumer)ArchivedLibrary[Queues &amp; Workers](/categories/queues)

greensight/laravel-phprdkafka-consumer
======================================

Opiniated High Level consumer for laravel-phprdkafka

0.1.0(4y ago)159MITPHPPHP ^8.0

Since Sep 30Pushed 4y agoCompare

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

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Laravel PHP Rdkafka Consumer
============================

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

`Deprecated, use https://github.com/ensi-platform/laravel-php-rdkafka-consumer instead`

Opiniated High Level consumer for [greensight/laravel-phprdkafka](https://github.com/greensight/laravel-php-rdkafka)

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

[](#installation)

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

Then,

```
composer require greensight/laravel-phprdkafka-consumer
```

Publish the config file with:

```
php artisan vendor:publish --provider="Greensight\LaravelPhpRdKafkaConsumer\LaravelPhpRdKafkaConsumerServiceProvider" --tag="kafka-consumer-config"
```

Now go to `config/kafka-consumer.php` and add processors there.

Usage
-----

[](#usage)

The package provides `php artisan kafka:consume {topic} {consumer=default}` command that executes the first processor that matches given topic and consumer name. Consumer name is taken from greensight/laravel-phprdkafka config file.

Processors in config have the following configuration options:

```
[
   /*
   | Optional, defaults to `null`.
   | Here you may specify which topic should be handled by this processor.
   | Processor handles all topics by default.
   */
   'topic' => 'stage.crm.fact.registrations.1',

   /*
   | Optional, defaults to `null`.
   | Here you may specify which greensight/laravel-phprdkafka consumer should be handled by this processor.
   | Processor handles all consumers by default.
   */
   'consumer' => 'default',

   /*
   | Optional, defaults to `action`.
   | Here you may specify processor's type. Defaults to `action`
   | Supported types:
   |  - `action` - a simple class with execute method;
   |  - `job` - Laravel Queue Job. It will be dispatched using `dispatch` or `dispatchSync` method;
   */
   'type' => 'action',

   /*
   | Required.
   | Fully qualified class name of a processor class.
   */
   'class' => \App\Domain\Communication\Actions\SendConfirmationEmailAction::class,

   /*
   | Optional, defaults to `false`.
   | Proxy messages to Laravel's queue.
   | Supported values:
   |  - `false` - do not stream message. Execute processor in syncronous mode;
   |  - `true` - stream message to Laravel's default queue;
   |  - `` - stream message to this queue;
   */
   'queue' => false,

   /*
   | Optional, defaults to 5000.
   | Kafka consume timeout in milliseconds .
   */
   'consume_timeout' => 5000,
]
```

### Synchronous processors

[](#synchronous-processors)

Most of the time all tou need is a synchronous processor. A simple example of such processor:

```
class SendConfirmationEmailAction
{
   public function execute(Message $message): void
   {
      // var_dump($message->payload);
   }
}
```

### Queueable processors

[](#queueable-processors)

If you want to stream message to Laravel's own queue you can use [spatie/laravel-queueable-action](https://github.com/spatie/laravel-queueable-action)

If for some reason you don't want to rely on that package you can swich to [Laravel Jobs](https://laravel.com/docs/master/queues#class-structure)

In both cases you also need to specify `'queue' => true` or `'queue' => 'my-favorite-queue'` in the package's config for a given processor.

Processor using Laravel Job example:

```
use RdKafka\Message;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;

class ConsumeMessageJob implements ShouldQueue
{
   use Dispatchable, InteractsWithQueue, Queueable;

   public function __construct(protected Message $message)
   {
   }

   public function handle(): void
   {
      // var_dump($this->message->payload);
   }
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

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

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

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

Unknown

Total

1

Last Release

1686d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58d505cd6b2551974b0c076d133fd9a3c9cd635bbf308adb17a6399bd3b63232?d=identicon)[Arrilot](/maintainers/Arrilot)

---

Top Contributors

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

---

Tags

laravelkafkagreensight

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/greensight-laravel-phprdkafka-consumer/health.svg)

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

###  Alternatives

[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

3786.5k](/packages/harris21-laravel-fuse)

PHPackages © 2026

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