https://github.com/uswitch/kf
kafka follow
https://github.com/uswitch/kf
Last synced: 11 months ago
JSON representation
kafka follow
- Host: GitHub
- URL: https://github.com/uswitch/kf
- Owner: uswitch
- License: bsd-2-clause
- Created: 2014-12-02T16:00:25.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-04-22T10:38:23.000Z (about 11 years ago)
- Last Synced: 2024-06-19T06:48:26.439Z (about 2 years ago)
- Language: Go
- Size: 144 KB
- Stars: 6
- Watchers: 55
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kf
A tool to consume and display Kafka messages. Compatible with Kafka 0.8 and up.
## Usage
$ kf --help
usage: kf [] []
Flags:
--help Show help.
-z, --zookeeper="localhost:2181"
host:port of zookeeper server (defaults to value of ZOOKEEPER environment variable)
-l, --list list available topics and quit
-v, --verbose log informative messages (including offsets)
-m, --max=0 maximum number of messages before stopping (0 = never stop)
-b, --from-beginning get messages from the beginning
-o, --offset=0 get messages from this offset (0 = get only new messages)
-g, --group="kf" consumer group
-c, --clientid="kf" client id
-p, --partition=0 partition
Args:
[] topic to listen for
$ export ZOOKEEPER=localhost:2181
$ kf sometopic
{"testing":"hello"...
$ kf -l
sometopic
topic1
topic2
...
## Prerequisites
#### Go
To install on Ubuntu
$ sudo apt-get install golang
To install on OSX
$ brew install go
Remember to set up a workspace and set GOPATH (see https://golang.org/doc/code.html)
It might also be a good idea to put `$GOPATH/bin` in your `PATH`.
### Mercurial
To install on Ubuntu
$ sudo apt-get install mercurial
To install on OSX
$ brew install mercurial
### Bazaar
To install on Ubuntu
$ sudo apt-get install bzr
To install on OSX
$ brew install bazaar
### Zookeeper libs/headers
To install on Ubuntu
$ sudo apt-get install libzookeeper-mt2 libzookeeper-mt-dev
To install on OSX
$ brew install zookeeper
## Installation
To install on Ubuntu
$ go get -u github.com/uswitch/kf
To install on OSX:
$ export CGO_CFLAGS='-I/usr/local/include/zookeeper'
$ export CGO_LDFLAGS='-L/usr/local/lib'
$ go get -u github.com/uswitch/kf
## Why?
kf (versus kafka-console-consumer.sh):
* starts up very quickly
* allows you to set an offset from which to receive a message
* allows you to get a list of available topics
* is 23 characters shorter to type!