tree: 3b2d98cb2f631307ff8f37be173bdc139f931e4e [path history] [tgz]
  1. src/
  2. tools/
  3. .gitignore
  4. kafka_test.go
  5. LICENSE
  6. Makefile
  7. README.md
clients/go/README.md

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.