Building a simple Kafka server with Go (v1.22) step by step, following the instructions on codecrafters.io.
In this challenge, we build a toy Kafka clone that's capable of accepting and responding to APIVersions & Fetch API requests. Along the way, we also learn about encoding and decoding messages using the Kafka wire protocol. We also learn about handling the network protocol, event loops, TCP sockets and more.
- Ensure you have
go (1.22)installed locally - Run
./your_program.shto run your Kafka broker, which is implemented inapp/server.go. The broker then listens for requests on port 9092.
At the moment this kafka server only listens for APIVersions requests and answers with error code 35 when the requested APIVersion is invalid, or responds with the supported versions if the request is valid.