简介:Go-Kafka-Example 是一个使用 Golang 编写的 Kafka 消费者和生产者的实例项目,旨在帮助开发者理解和实现 Kafka 在 Go 语言中的应用。
Golang Kafka示例
本示例展示了如何使用Golang编写Kafka消费者和生产者。
**设置**
- **制片人**
```bash
go run cmdproducermain.go
```
- **消费者**
标志:
- `brokerList`
- `话题`
- 分区(默认值:0)
- `offsetType`
- `messageCountStart`(默认值:0)
```bash
go run cmdconsumermain.go
```
示例输出:
```
Received messages Something Cool #1
Received messages Something Cool #2
Received messages Something Cool #3
Received messages Something Cool #4
Received messages Something Cool #5
```
**贡献**
我们非常感谢您对go-kafka-example的贡献,请查看LICEN。