aplr / kafkaesk
Laravel Kafka queue driver
Installs: 1 940
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 2
Forks: 5
Open Issues: 5
Requires
- php: >=7.2.0
- ext-rdkafka: *
- graham-campbell/manager: ^4.5
- illuminate/console: ^6.0|^7.0|^8.0
- illuminate/contracts: ^6.0|^7.0|^8.0
- illuminate/database: ^6.0|^7.0|^8.0
- illuminate/queue: ^6.0|^7.0|^8.0
- illuminate/support: ^6.0|^7.0|^8.0
Requires (Dev)
- graham-campbell/analyzer: ^3.0
- graham-campbell/testbench: ^5.4
- hamcrest/hamcrest-php: ^2.0
- kwn/php-rdkafka-stubs: ^2.0
- mockery/mockery: ^1.3
- phpro/grumphp: ^0.18
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-11-05 10:43:57 UTC
README
Kafkaesk adds support for Apache Kafka to Laravel Queues. It builds upon the rdkafka php extension, which you will have to install seperately. Also, you have to install the C/C++ client library librdkafka upfront. Afterwards, you can freely push jobs to your favorite Kafka queue!
Kafkaesk supports PHP 7.2-7.4 and requires Laravel 6-7. If you still need to support Laravel 5 use rapideinternet/laravel-queue-kafka, which Kafkaesk is a fork of.
Installation
To install the latest version of aplr/kafkaesk
just require it using composer.
composer require aplr/kafkaesk
This package is using Laravel's package auto-discovery, so it doesn't require you to manually add the ServiceProvider. If you've opted out of this feature, add the ServiceProvider to the providers array in config/app.php:
Aplr\Kafkaesk\ServiceProvider::class,
Requirements
Make sure you have installed the C/C++ client library librdkafka. If you're running macOS, you can simply use Homebrew to install it.
brew install librdkafka
Additionally you have to install the php extension rdkafka. You can do this either manually or simply by using pecl.
pecl install rdkafka
If both installs succeed, you're all set!
Configuration
The default configuration is set in config/kafkaesk.php
. Merge the contents of this file with the connections
array in your local config/queue.php
. You can do this using the command below.
php artisan vendor:publish --provider="Aplr\Kafkaesk\ServiceProvider"
Environment variables
When using the default configuration, you can also use the environment variables described below to configure the queue driver.
Usage
Since Kafkaesk is just a driver for Laravel Queues, just read through their extensive documentation.
Limitations
Currently, deferring jobs on the queue using the later
function of Laravel Queues is not yet supported by this library. Feel free to add support by creating a PR!
Acknowledgements
This library is a fork of the outdated rapideinternet/laravel-queue-kafka, adding support for Laravel 6-7, fixing tests and fancying everything up a bit.
Licence
Kafkaesk is licenced under The MIT Licence (MIT).