Examples

Sarama, Go Client

Sarama is a Go client library for Apache Kafka.


Console Producer

The console producer can be built and installed with:

go install github.com/IBM/sarama/tools/kafka-console-producer

Messages can be produced from the console:

$GOPATH/bin/kafka-console-producer \
  -verbose \
  -topic=test \
  -key=abc \
  -value=def \
  -headers=foo:bar,bar:foo \
  -brokers=localhost:9092

Console Consumer

The console consumer can be built and installed with:

go install github.com/IBM/sarama/tools/kafka-console-consumer

Messages can be consumed from a topic with:

$GOPATH/bin/kafka-console-consumer \
  -verbose \
  -topic=test \
  -offset=oldest \
  -brokers=localhost:9092
Previous
Schema Registry