2017 © Pedro Peláez
 

library laravel-queue-kafka

Kafka driver for Laravel Queue

image

rapide/laravel-queue-kafka

Kafka driver for Laravel Queue

  • Monday, March 12, 2018
  • by rapideinternet
  • Repository
  • 4 Watchers
  • 27 Stars
  • 542 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 11 Forks
  • 4 Open issues
  • 4 Versions
  • 371 % Grown

The README.md

Kafka Queue driver for Laravel

Latest Stable Version Build Status Total Downloads StyleCI Software License, (*1)

Installation

  1. Install librdkafka c library, (*2)

    $ cd /tmp
    $ mkdir librdkafka
    $ cd librdkafka
    $ git clone https://github.com/edenhill/librdkafka.git .
    $ ./configure
    $ make
    $ make install
    
  2. Install the php-rdkafka PECL extension, (*3)

    $ pecl install rdkafka
    
  3. a. Add the following to your php.ini file to enable the php-rdkafka extension extension=rdkafka.so, (*4)

    b. Check if rdkafka is installed
    Note: If you want to run this on php-fpm restart your php-fpm first., (*5)

    php -i | grep rdkafka, (*6)

    Your output should look something like this, (*7)

    rdkafka rdkafka support => enabled librdkafka version (runtime) => 1.0.0-RC2 librdkafka version (build) => 0.11.4.0, (*8)

  4. Install this package via composer using:, (*9)

    composer require rapide/laravel-queue-kafka
  5. Add LaravelQueueKafkaServiceProvider to providers array in config/app.php:, (*10)

    Rapide\LaravelQueueKafka\LaravelQueueKafkaServiceProvider::class,

    If you are using Lumen, put this in bootstrap/app.php, (*11)

    $app->register(Rapide\LaravelQueueKafka\LumenQueueKafkaServiceProvider::class);
  6. Add these properties to .env with proper values:, (*12)

    QUEUE_DRIVER=kafka
  7. If you want to run a worker for a specific consumer group, (*13)

    export KAFKA_CONSUMER_GROUP_ID="group2" && php artisan queue:work --sleep=3 --tries=3

    Explaination of consumergroups can be found in this article http://blog.cloudera.com/blog/2018/05/scalability-of-kafka-messaging-using-consumer-groups/, (*14)

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, (*15)

Testing

Run the tests with:, (*16)

bash vendor/bin/phpunit, (*17)

Acknowledgement

This library is inspired by laravel-queue-rabbitmq by vyuldashev. And the Kafka implementations by Superbalist be sure to check those out., (*18)

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., (*19)

Supported versions of Laravel

Tested on: [5.4, 5.5, 5.6, 5.7], (*20)

New version is underway

A version for Laravel 6,7,8 is underway. Also supporting the new RdKafka library, (*21)

The Versions

12/03 2018

dev-master

9999999-dev

Kafka driver for Laravel Queue

  Sources   Download

MIT

The Requires

 

The Development Requires

by Peter Mein

12/03 2018

0.3.0

0.3.0.0

Kafka driver for Laravel Queue

  Sources   Download

MIT

The Requires

 

The Development Requires

by Peter Mein

26/09 2017

0.2.0

0.2.0.0

Kafka driver for Laravel Queue

  Sources   Download

MIT

The Requires

 

The Development Requires

by Peter Mein

04/08 2017

0.1.0

0.1.0.0

Kafka driver for Laravel Queue

  Sources   Download

MIT

The Requires

 

The Development Requires

by Peter Mein