https://github.com/swoole/phpkafka
PHP Kafka client is used in PHP-FPM and Swoole. PHP Kafka client supports 50 APIs, which might be one that supports the most message types ever.
https://github.com/swoole/phpkafka
kafka php swoole
Last synced: 6 months ago
JSON representation
PHP Kafka client is used in PHP-FPM and Swoole. PHP Kafka client supports 50 APIs, which might be one that supports the most message types ever.
- Host: GitHub
- URL: https://github.com/swoole/phpkafka
- Owner: swoole
- License: apache-2.0
- Created: 2020-08-24T03:23:47.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-21T11:43:29.000Z (over 1 year ago)
- Last Synced: 2024-11-24T21:03:18.012Z (12 months ago)
- Topics: kafka, php, swoole
- Language: PHP
- Homepage: https://longlang.org/
- Size: 485 KB
- Stars: 270
- Watchers: 10
- Forks: 47
- Open Issues: 26
-
Metadata Files:
- Readme: README.cn.md
- License: LICENSE
Awesome Lists containing this project
- awesome-swoole - longlang/phpkafka - A coroutine-based [Kafka](https://kafka.apache.org) client. (Tasks and Queues)
README
# longlang/phpkafka
[](https://packagist.org/packages/longlang/phpkafka)
[](https://secure.php.net/)
[](https://github.com/longyan/phpkafka/blob/master/LICENSE)
## 简介
[English](README.md) | 简体中文
PHP Kafka 客户端,支持 PHP-FPM、Swoole 环境使用。
通讯协议的结构基于 Java 版本中的 JSON 文件生成,这可能是有史以来支持消息类型最多的 PHP Kafka 客户端,支持全部 50 个 API。
> 目前已实现消息的生成及消费,本组件仍处于开发及测试阶段。
## 功能特性
- [x] 支持全部 50 个 API
- [x] 消息压缩支持 (gzip、snappy、lz4、zstd)
- [x] PHP-FPM、Swoole 智能环境识别兼容
- [x] 生产者类
- [x] 消费者类
- [x] SASL 鉴权
- [x] SSL 加密通信
- [ ] 更多功能的封装及测试用例编写
## 环境要求
- PHP >= 7.1
- Kafka >= 1.0.0
- Swoole >= 4.5 (可选)
## 安装
`composer require longlang/phpkafka`
## 文档及示例
- [生产者](doc/producer.md)
- [消费者](doc/consumer.md)
示例代码请参考 `examples` 目录