Kafka.go - Publisher & Consumer for Kafka in Go

Kafka is a distributed publish-subscribe messaging system: (http://incubator.apache.org/kafka/)

Go language: (http://golang.org/)

Get up and running

Install go:
For more info see: http://golang.org/doc/install.html#install

Make sure to set your GOROOT properly (http://golang.org/doc/install.html#environment).

Install kafka.go package:
make install
Make the tools (publisher & consumer)
make tools
Start zookeeper, Kafka server
For more info on Kafka, see: http://incubator.apache.org/kafka/quickstart.html

Tools

Start a consumer:

Now the consumer will just poll until a message is received.

Publish a message:

The consumer should output message.

API Usage

Publishing

Publishing Compressed Messages

Consumer

Or the consumer can use a channel based approach:

Consuming Offsets

Contact

jeffreydamick (at) gmail (dot) com

http://twitter.com/jeffreydamick

Big thank you to NeuStar for sponsoring this work.