Skip to content

thaiph99/kafka-cpp

Repository files navigation

Simple Kafka (C++)

Simple Kafka server.

Project Structure

src/
├── main.cpp        # Main entry point
├── server.h        # Server interface  
├── server.cpp      # Core server logic
├── network.h       # Network utilities interface
├── network.cpp     # Socket management
├── protocol.h      # Protocol definitions
├── protocol.cpp    # Message parsing and response creation
├── logger.h        # Log definitions
└── logger.cpp      # Logging utilities

Building

# Simple build
g++ -std=c++23 -Wall -Wextra -Isrc src/*.cpp -o kafka

# Or with CMake
cmake -B build -S .
cmake --build build

Running

# Start the server
./kafka

# Test with a client (in another terminal)
echo -n "0000002300120004628b8f0500096b61666b612d636c69000a6b61666b612d636c6904302e3100" | xxd -r -p | nc localhost 9092 | hexdump -C

Features

  • Kafka Protocol: Supports API_VERSIONS, DESCRIBE_TOPIC_PARTITIONS, and FETCH requests
  • Multi-client: Handles multiple requests per connection
  • Modern C++: C++23 standard with zero dependencies

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published