twidpay/utils

Utils for twidpay

Installs: 6 802

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/twidpay/utils

3.0.0 2025-10-13 07:34 UTC

README

This PHP library provides a convenient way to produce messages to Kafka topics using the RdKafka PHP extension.

Installation

  1. Requirements:

  2. Installation via Composer:

    You can install the library via Composer. Run the following command in your terminal:

    composer require twidpay/utils
  3. 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);