1. Go to this page and download the library: Download siberfx/apache-kafka 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/ */
siberfx / apache-kafka example snippets
php
// config/kafka-config.php file content, you can modify it by your own settings.
return [
'queue_name' => 'kafka',
'bootstrap_servers' => env('BOOTSTRAP_SERVER', ''),
'security_protocol' => env('SECURITY_PROTOCOL', ''),
'sasl_mechanisms' => env('SASL_MECHANISM', ''),
'sasl_username' => env('SASL_USERNAME', ''),
'group_id' => env('GROUP_ID', ''),
];