koo / laravel-queue-kafka
Kafka driver for Laravel Queue
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Language:HTML
Requires
- php: >=5.6.4
- illuminate/database: 5.5.*
- illuminate/queue: 5.5.*
- illuminate/support: 5.5.*
Requires (Dev)
- mockery/mockery: ^0.9.5
- phpunit/phpunit: ^5.5
This package is auto-updated.
Last update: 2024-10-18 18:03:25 UTC
README
Inspired By
Installation
-
Install librdkafka c library
$ cd /tmp $ mkdir librdkafka $ cd librdkafka $ git clone https://github.com/edenhill/librdkafka.git . $ ./configure $ make $ make install
-
Install the php-rdkafka PECL extension
$ pecl install rdkafka
-
Add the following to your php.ini file to enable the php-rdkafka extension
extension=rdkafka.so
-
Install this package via composer using:
composer require koo/laravel-queue-kafka
-
Add LaravelQueueKafkaServiceProvider to
providers
array inconfig/app.php
:Koo\LaravelQueueKafka\LaravelQueueKafkaServiceProvider::class,
If you are using Lumen, put this in
bootstrap/app.php
$app->register(Koo\LaravelQueueKafka\LumenQueueKafkaServiceProvider::class);
-
Add these properties to
.env
with proper values:QUEUE_DRIVER=kafka
Usage
Once you completed the configuration you can use Laravel Queue API. If you used other queue drivers you do not need to change anything else. If you do not know how to use Queue API, please refer to the official Laravel documentation: http://laravel.com/docs/queues
Testing
Run the tests with:
vendor/bin/phpunit
Acknowledgement
This library is inspired by laravel-queue-rabbitmq by vyuldashev. And the Kafka implementations by Superbalist be sure to check those out.
Contribution
You can contribute to this package by discovering bugs and opening issues. Please, add to which version of package you create pull request or issue.
Supported versions of Laravel
Tested on: [5.5]