Download the PHP package greensight/laravel-phprdkafka-consumer without Composer
On this page you can find all versions of the php package greensight/laravel-phprdkafka-consumer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download greensight/laravel-phprdkafka-consumer
More information about greensight/laravel-phprdkafka-consumer
Files in greensight/laravel-phprdkafka-consumer
Package laravel-phprdkafka-consumer
Short Description Opiniated High Level consumer for laravel-phprdkafka
License MIT
Homepage https://github.com/greensight/laravel-phprdkafka-consumer
Informations about the package laravel-phprdkafka-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
Installation
Firstly, you have to install and configure greensight/laravel-phprdkafka
Then,
Publish the config file with:
Now go to config/kafka-consumer.php
and add processors there.
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:
Synchronous processors
Most of the time all tou need is a synchronous processor. A simple example of such processor:
Queueable processors
If you want to stream message to Laravel's own queue you can use spatie/laravel-queueable-action
If for some reason you don't want to rely on that package you can swich to Laravel Jobs
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:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-phprdkafka-consumer with dependencies
ext-rdkafka Version *
greensight/laravel-phprdkafka Version ^0.1.4
illuminate/support Version ^7 || ^8