Categorygithub.com/musobarlab/kafka-cli
modulepackage
1.0.0
Repository: https://github.com/musobarlab/kafka-cli.git
Documentation: pkg.go.dev

# README

Kafka CLI

Kafka cli client

Install

Build from source

Require Go version 1.10 or higher

$ git clone https://github.com/musobarlab/kafka-cli.git

$ make build

$ kafka-cli --version

Mac OS

$ brew tap wuriyanto48/tool

$ brew install kafka-cli

$ kafka-cli --version

Linux

$ wget https://github.com/musobarlab/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/musobarlab/kafka-cli/releases

Usage

Publish message to Kafka broker and topic

$ kafka-cli pub -broker localhost:9092 -topic wurys -m "hahahaha" -V

JSON

$ kafka-cli pub -broker localhost:9092 -topic wurys -m "{"hello":"hello", "world":"world"}" -V

or multiple broker

$ kafka-cli pub -broker localhost:9092,localhost:9093,localhost:9094 -topic wurys -m "hahahaha" -V

Subscribe to Kafka broker and topic

$ kafka-cli sub -broker localhost:9092 -topic wurys

or multiple broker

$ 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

$ kafka-cli sub -broker localhost:9092,localhost:9093,localhost:9094 -topic wurys -auth
$ username: your-username
$ password: your-password

# Packages

No description provided by the author

# Functions

CommandFromString function.
NewKafkaGoPublisherImpl constructor of KafkaGoPublisherImpl.
NewKafkaGoSubscriber constructor of KafkaGoSubscriberImpl.
NewSaramaPublisher constructor of SaramaPublisherImpl.
NewSaramaSubscriber constructor of SaramaSubscriberImpl.
ParseArgument function.

# Constants

PublishCommand command.
SubscribeCommand command.
Version const.

# Variables

ErrorInvalidCommand error.
ErrorPubRequredMessage error.
ErrorRequiredOneArgument error.
ErrorRequiredOneBroker error.
ErrorRequiredTopicName error.
No description provided by the author
No description provided by the author

# Structs

Argument struct.
KafkaGoPublisherImpl struct.
KafkaGoSubscriberImpl struct.
Runner type.
SaramaPublisherImpl struct.
SaramaSubscriberImpl struct.
No description provided by the author
SubscriberHandler struct will implement ConsumerGroupHandler.

# Interfaces

Publisher interface.
Subscriber interface.

# Type aliases

Command type.