longlang / phpkafka
A kafka client. Support php-fpm and Swoole.
Requires
- php: >=7.1
- chdemko/sorted-collections: ^1.0
- exussum12/xxhash: ^1.0.0
- google/crc32: ^0.1.0
- symfony/polyfill-php81: ^1.23
Requires (Dev)
- colinodell/json5: ^2.1
- friendsofphp/php-cs-fixer: ^2.18
- phpstan/phpstan: ^0.12.81
- phpunit/phpunit: ^7.5|^8.0|^9.0
- swoole/ide-helper: ^4.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This project has moved to swoole/library and this repository will be archived.
The client now lives in the Swoole\Kafka namespace. It is loaded through Composer and is not compiled into the Swoole extension.
composer require swoole/library
Documentation: consumer, producer. Examples: examples/kafka.
Replace longlang\phpkafka\ with Swoole\Kafka\. The code below is the last version published from this repository.
Introduction
English | 简体中文
PHP Kafka client is used in PHP-FPM and Swoole.
The communication protocol is based on the JSON file in Java. PHP Kafka client supports 50 APIs, which might be one that supports the most message types ever.
The produce and the consume of messages are implemented. The component is in developing and testing.
Features
- Support all 50 APIs
- Message compression
- PHP-FPM and Swoole compatible
- Producer
- Consumer
- SASL
- SSL
- More features and test cases
Environment
- PHP >= 7.1
- Kafka >= 1.0.0
- Swoole >= 4.5 (optional)
Installation
composer require longlang/phpkafka
Documentation and Examples
Refer to examples for code examples.