Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```