1. Go to this page and download the library: Download glsv/yii2kafka library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
glsv / yii2kafka example snippets
composer
composer
composer
components = [
'class' => \yii2Kafka\YiiKafkaComponent::class,
'brokers' => ['kafka:9092']
/**
* https://github.com/weiboad/kafka-php
*/
'adapter' => [
'class' => \yii2Kafka\adapters\nmred\NmredAdapter::class,
'params' => [
////////
// Use the params for the client at the link:
// https://github.com/weiboad/kafka-php/blob/master/docs/Configure.md
////////
'global' => [],
'producer' => [
'isAsyn' => false,
'