Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
RamiiYoussef committed Feb 28, 2024
1 parent 716370c commit 7937293
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 36 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

### Laravel ###
/vendor/
composer.lock

### macOS ###
# General
Expand Down Expand Up @@ -46,4 +47,4 @@ Temporary Items

# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)

/coverage/
/coverage/
1 change: 0 additions & 1 deletion .phpunit.result.cache

This file was deleted.

12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

laravel-kafka adds support for Apache Kafka to Laravel Queues. It builds upon the [rdkafka](https://github.com/arnaud-lb/php-rdkafka) php extension, which you will have to install seperately. Also, you have to install the C/C++ client library [librdkafka](https://github.com/edenhill/librdkafka) upfront. Afterwards, you can freely push jobs to your favorite Kafka queue!

laravel-kafka supports PHP 8.1/8.2 and Laravel 9/10.
laravel-kafka supports PHP 8.1/8.2/8.3 and Laravel 10.

## Installation

Expand All @@ -12,8 +12,14 @@ To install the latest version of `ramiiyoussef/laravel-kafka` just require it us
composer require ramiiyoussef/laravel-kafka
```

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:

Environments:
```bash
KAFKA_BROKER_LIST=127.0.0.1:9092
KAFKA_QUEUE=topic_a
KAFKA_QUEUE_GROUP=group1
KAFKA_AUTH_LOGIN=
KAFKA_AUTH_PASSWORD=
```

## Licence

Expand Down
4 changes: 3 additions & 1 deletion config/queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

'broker_list' => env('KAFKA_BROKER_LIST', 'kafka:9092'),
'queue' => env('KAFKA_QUEUE', 'default'),
'heartbeat' => 5 * 1000,
'group_name' => env('KAFKA_QUEUE_GROUP', 'default'),

'heartbeat' => 5 * 1000,
'producer_timeout' => 1 * 1000,
'consumer_timeout' => 3 * 1000,

'auth_login' => env('KAFKA_AUTH_LOGIN'),
'auth_mechanism' => env('KAFKA_AUTH_MECHANISM', 'PLAIN'),
'auth_password' => env('KAFKA_AUTH_PASSWORD'),
Expand Down
30 changes: 0 additions & 30 deletions phpunit.xml.dist.bak

This file was deleted.

4 changes: 4 additions & 0 deletions src/KafkaServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class KafkaServiceProvider extends ServiceProvider
*/
public function boot(): void
{
$this->publishes([
__DIR__ . '/../config/kafka.php' => config_path('kafka.php'),
], 'laravel-queue-kafka-config');

$this->app['queue']->addConnector('kafka', function () {
return new KafkaConnector();
});
Expand Down

0 comments on commit 7937293

Please sign in to comment.