leroy-merlin-br / metamorphosis
Kafka package for laravel applications
Installs: 20 759
Dependents: 0
Suggesters: 0
Security: 0
Stars: 42
Watchers: 40
Forks: 10
Open Issues: 3
Requires
- php: ^8.0
- ext-json: *
- ext-rdkafka: >=4.0
- guzzlehttp/guzzle: ^6.5.0 || ^7.0
- illuminate/config: ^9.0 || ^10.0
- illuminate/console: ^9.0 || ^10.0
- illuminate/support: ^9.0 || ^10.0
- rg/avro-php: ^3.0
Requires (Dev)
- dms/phpunit-arraysubset-asserts: ^0.2.1
- kwn/php-rdkafka-stubs: ^2.2.1
- leroy-merlin-br/coding-standard: ^v3.1.0
- mockery/mockery: ^1.6.6
- orchestra/testbench: ^7.0|^8.0
- phpro/grumphp: ^1.16.0
- phpunit/phpunit: ^9.6.10
- psalm/plugin-mockery: ^0.9.1
- rector/rector: ^0.13.10
- vimeo/psalm: ^4.30.0
- dev-master
- v5.0.0
- v4.4.0
- v4.3.0
- v4.2.0
- v4.1.0
- v4.0.0
- v3.3.0
- v3.2.8
- v3.2.7
- v3.2.6
- v3.2.5
- v3.2.4
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.0
- v3.0.9
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.2.0
- v2.1.1
- v2.1.0
- v2.0.0
- v1.2.0
- v1.1.0
- v1.0.0
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.2
- v0.1.1
- v0.1.0
- dev-develop
- dev-chore/configOptions-refinement
- dev-chore/validate-dev
- dev-chore/upgrade-pkgs
- dev-chore/configOptions
- dev-tests/kafka-tests
- dev-fix/catch-any-throwable
- dev-fix/catch-any-throwable-bkp
- dev-chore-improve-dynamic-config
This package is auto-updated.
Last update: 2024-10-23 13:16:29 UTC
README
Easy and flexible Kafka Library for Laravel and PHP 7.
- Introduction
- Requirements
- Installation
- Quick Usage Guide
- Advanced Usage Guide
- Upgrade Guide
- Contributing
- License
Introduction
Metamorphosis provides a simple, straight-forward implementation for working with Kafka inside Laravel applications.
Prefer to read in other language?
Requirements
- PHP >= 7.1
- Kafka Driver
- Kafka PHP Extension
Installation
1. Install the Kafka driver
On Mac OSX, install librdkafka with homebrew:
brew install librdkafka
On Debian and Ubuntu, install librdkafka from the Confluent APT repositories, see instructions here and then install librdkafka:
apt install librdkafka-dev
On RedHat, CentOS, Fedora, install librdkafka from the Confluent YUM repositories, instructions here and then install librdkafka:
yum install librdkafka-devel
On Windows, reference librdkafka.redist NuGet package in your Visual Studio project.
2. Install the PHP Kafka extension
On Linux, Unix and OS X, you can install extensions using the PHP Extension Community Library (PECL):
pecl install rdkafka
then add the following to your .ini file:
extension=rdkafka.so
Important: When using multiple PHP versions, PECL will install the package for the latest PHP version only. To set a PHP version, download the source code and compile it specifying the target PHP version.
PHP 7.4 example:
pecl download rdkafka
tar -xvf rdkafka-X.x.x.tgz
cd rdkafka-X.x.x
phpize
./configure --with-php-config=/usr/bin/php-config7.4
make
sudo make install
then add the extension to your .ini file:
extension=rdkafka.so
More about compiling shared PECL extensions
On Windows, download the rdkafka DLL, put the file in your PHP/ext folder and add the extension to your php.ini file:
extension=rdkafka.dll
More about PECL on Windows
3. Install Metamorphosis
Install the library via Composer:
composer require leroy-merlin-br/metamorphosis
And publish the config file with:
php artisan vendor:publish --provider="Metamorphosis\MetamorphosisServiceProvider"
For usage instructions, please refer to our Quick Usage Guide.
License
Metamorphosis is free software distributed under the terms of the MIT license
Additional information
Metamorphosis was proudly built by the Leroy Merlin Brazil team. See all the contributors.