Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/telkomdev/kafka-cli
Kafka command line client written in Go
https://github.com/telkomdev/kafka-cli
cli go golang kafka kafka-client
Last synced: about 5 hours ago
JSON representation
Kafka command line client written in Go
- Host: GitHub
- URL: https://github.com/telkomdev/kafka-cli
- Owner: telkomdev
- License: mit
- Created: 2019-04-27T10:23:18.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T03:21:13.000Z (over 1 year ago)
- Last Synced: 2024-06-21T09:19:21.015Z (5 months ago)
- Topics: cli, go, golang, kafka, kafka-client
- Language: Go
- Homepage:
- Size: 69.3 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Kafka CLI
Kafka cli client
### Install
Build from source
Require `Go` version `1.10` or higher
```shell
$ git clone https://github.com/telkomdev/kafka-cli.git$ make build
$ kafka-cli --version
```Mac OS
```shell
$ brew tap wuriyanto48/tool$ brew install kafka-cli
$ kafka-cli --version
```Linux
```shell
$ wget https://github.com/telkomdev/kafka-cli/releases/download/v0.0.0/kafka-cli-v0.0.0.linux-amd64.tar.gz$ tar -zxvf kafka-cli-v0.0.0.linux-amd64.tar.gz
$ kafka-cli --version
```Windows
Download latest version https://github.com/telkomdev/kafka-cli/releases
### Usage
Publish message to Kafka broker and topic
```shell
$ kafka-cli pub -broker localhost:9092 -topic wurys -m "hahahaha" -V
```JSON
```shell
$ kafka-cli pub -broker localhost:9092 -topic wurys -m "{"hello":"hello", "world":"world"}" -V
```or multiple broker
```shell
$ kafka-cli pub -broker localhost:9092,localhost:9093,localhost:9094 -topic wurys -m "hahahaha" -V
```Subscribe to Kafka broker and topic
```shell
$ kafka-cli sub -broker localhost:9092 -topic wurys
```or multiple broker
```shell
$ kafka-cli sub -broker localhost:9092,localhost:9093,localhost:9094 -topic wurys
```SASL auth mechanism
you need add `-auth` flag for prompting username and password
```shell
$ kafka-cli sub -broker localhost:9092,localhost:9093,localhost:9094 -topic wurys -auth
$ username: your-username
$ password: your-password
```