Kafka Go client quick start

Here is a Docker based example for Kafka using Go client

Photo by Braden Collum on Unsplash

These are simple producer and consumer apps based on Confluent Go client for Kafka which itself is built on top of librdkafka (Kafka C client)

I struggled with the Windows setup and chose the Docker route — client setup part is taken care of with a pre-built Docker image — here is the Dockerfile. You can also opt to build your image and update the producer and consumer Dockerfile(s) to reference them


  • uses the traditional API for pushing messages to Kafka (channel is another option)
  • receives notifications on the (default) Events (custom channel is another option or you can choose not to get notified)

Consumer — uses (Events) channel – Poll()ing is another alternative

To run

Check out the README — it’s super easy to get going, thanks to Docker Compose which is used to bootstrap the sample app (producer and consumer) as a single unit

BYOK (bring your own Kafka) for trying this out. For Kafka on Docker — I would recommend using Confluent Docker images or wurstmeister/kafka is also a great option



Originally published at simplydistributed.wordpress.com on September 14, 2018.

Currently working with Kafka, Databases, Azure, Kubernetes and related open source projects | Confluent Community Catalyst (for Kafka)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store