Post

MonKafka: A Minimalist Implementation of the Kafka Protocol

An attempt to implement basic components of the Kafka protocol.

Intro

MonKafka is a minimalistic implementation of part of the Kafka protocol.

In its current state, the code can simulate topic creation. It spins up the server (TCP listener), when we run run kafka-topics.sh --create, the server communicates in Kafka’s protocol to make the CLI client think the topic was created. The code aims to achieve this in the simplest way. See the TODO section for future plans.

Testing

I am running go1.23.4 for my local testing.

  1. Start the server locally on port 9092:

    1
    
     go run main.go
    
  2. I am testing with Kafka 3.9:

    1
    2
    3
    
     bin/kafka-topics.sh --create --topic mytopic  --bootstrap-server localhost:9092    
    
     Created topic mytopic.
    

TODO

  • Simulate Topic Creation
  • Actually parse requests (so far, only topic name is retrieved)
  • Produce
  • Fetch
This post is licensed under CC BY 4.0 by the author.