twidpay / utils
Utils for twidpay
1.0.7
2024-04-04 08:49 UTC
Requires
- ramsey/uuid: ^4.2.2
- twidpay/twid-logger: ^1.0
Requires (Dev)
- php-mock/php-mock: ^2.2
- phpunit/phpunit: ^7.0|^8.0|^9.0
This package is auto-updated.
Last update: 2024-04-04 08:49:30 UTC
README
This PHP library provides a convenient way to produce messages to Kafka topics using the RdKafka PHP extension.
Installation
-
Requirements:
- RdKafka PHP extension (Installation Instructions)
-
Installation via Composer:
You can install the library via Composer. Run the following command in your terminal:
composer require twidpay/utils
-
Usage:
- All possible configurations for the KafkaProducer can be found here
use Utils\queue\KafkaProducer; $config = [ 'metadata.broker.list' => 'localhost:9092', 'compression.codec' => 'snappy', 'security.protocol' => 'ssl', //other kafka configuration ]; $this->kafkaProducer = new KafkaProducer($config); //key is optional $this->kafkaProducer->produce($topic, $message, $key);