Loading...

Build your own Kafka

Learn about TCP servers, the Kafka wire protocol and more.

Start Building
C
C
C#
C#
C++
C++
Elixir
Elixir
Gleam
Gleam
Go
Go
Java
Java
JavaScript
JavaScript
Kotlin
Kotlin
Python
Python
Rust
Rust
TypeScript
TypeScript
Zig
Zig

This challenge requires a CodeCrafters Membership.

You're welcome to study the full challenge structure and stage instructions for free. A membership is needed for submitting code and viewing solutions.

Want to try a free challenge? Try Build your own Shell — it's free until 1 February 2026.

Apache Kafka is a distributed event streaming platform often used for high-performance data pipelines. In this challenge, you'll build your own Kafka broker that's capable of serving basic requests.

Along the way you'll learn about TCP servers, the Kafka wire protocol and more.

Stages

Bind to a port
Login via GitHub to view this stage
Send Correlation ID
Login via GitHub to view this stage
Parse Correlation ID
Login via GitHub to view this stage
Parse API Version
Login via GitHub to view this stage
Handle ApiVersions requests
Login via GitHub to view this stage

Concurrent Clients

Serial requests
Login via GitHub to view this stage
Concurrent requests
Login via GitHub to view this stage

Listing Partitions

Include DescribeTopicPartitions in ApiVersions
Login via GitHub to view this stage
List for an unknown topic
Login via GitHub to view this stage
List for a single partition
Login via GitHub to view this stage
List for multiple partitions
Login via GitHub to view this stage
List for multiple topics
Login via GitHub to view this stage

Consuming Messages

Include Fetch in ApiVersions
Login via GitHub to view this stage
Fetch with no topics
Login via GitHub to view this stage
Fetch with an unknown topic
Login via GitHub to view this stage
Fetch with an empty topic
Login via GitHub to view this stage
Fetch single message from disk
Login via GitHub to view this stage
Fetch multiple messages from disk
Login via GitHub to view this stage

Producing Messages

Include Produce in ApiVersions
Login via GitHub to view this stage
Respond for invalid topic or partition
Login via GitHub to view this stage
Respond for valid topic and partition
Login via GitHub to view this stage
Produce a single record
Login via GitHub to view this stage
Produce multiple records
Login via GitHub to view this stage
Produce to multiple partitions
Login via GitHub to view this stage
Produce to multiple partitions of multiple topics
Login via GitHub to view this stage