PHP Kafka Client Library (longlang/phpkafka) Overview
The PHP Kafka client library supports PHP‑FPM and Swoole environments, implements all 50 Kafka APIs with compression, SSL, and SASL features, requires PHP ≥ 7.1 and Kafka ≥ 1.0.0, and can be installed via Composer.
Introduction
PHP Kafka client library, compatible with PHP‑FPM and Swoole environments.
The communication protocol structure is generated from the Java version's JSON files, making this possibly the PHP Kafka client with the most supported message types, covering all 50 APIs.
Message production and consumption are currently implemented, but the component is still in development and testing.
Features
Support for all 50 APIs
Message compression support (gzip, snappy, lz4, zstd)
Intelligent environment detection for PHP‑FPM and Swoole
Producer class
Consumer class
SSL encrypted communication
SASL authentication
Additional feature encapsulation and test case development
Environment Requirements
PHP >= 7.1
Kafka >= 1.0.0
Swoole >= 4.5 (optional)
Installation
composer require longlang/phpkafka
Laravel Tech Community
Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.