greensight / laravel-phprdkafka-producer
Opiniated High Level producer for laravel-phprdkafka
Installs: 86
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
Language:Shell
Requires
- php: ^8.0
- ext-rdkafka: *
- greensight/laravel-phprdkafka: ^0.1.4
Requires (Dev)
- brianium/paratest: ^6.2
- nunomaduro/collision: ^5.3
- orchestra/testbench: ^6.15
- phpunit/phpunit: ^9.3
- spatie/laravel-ray: ^1.9
This package is auto-updated.
Last update: 2021-10-05 19:55:08 UTC
README
Deprecated, use https://github.com/ensi-platform/laravel-php-rdkafka-producer instead
Opiniated High Level producer for greensight/laravel-phprdkafka
Installation
Firstly, you have to install and configure greensight/laravel-phprdkafka
Then,
composer require greensight/laravel-phprdkafka-producer
Usage
Send a single message:
use Greensight\LaravelPhpRdKafkaProducer\HighLevelProducer; (new HighLevelProducer($topicName))->sendOne($messageString);
Send several messages at once:
(new HighLevelProducer($topicName))->sendMany([$message1String, $message2String]);
All options with defaults:
use Greensight\LaravelPhpRdKafkaProducer\HighLevelProducer; use Greensight\LaravelPhpRdKafkaProducer\Exceptions\KafkaProducerException; $producer = new HighLevelProducer( topicName: $topicName, producerName: 'some-producer-from-greensight/laravel-phprdkafka-config', flushTimeout: 5000, // ms flushRetries: 5, ); try { $producer ->setFlushTimeout(10000) ->setFlushRetries(10) ->sendOne($messageString); } catch (KafkaProducerException $e) { //... }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.