Simple Kafka server.
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
# Simple build
g++ -std=c++23 -Wall -Wextra -Isrc src/*.cpp -o kafka
# Or with CMake
cmake -B build -S .
cmake --build build
# Start the server
./kafka
# Test with a client (in another terminal)
echo -n "0000002300120004628b8f0500096b61666b612d636c69000a6b61666b612d636c6904302e3100" | xxd -r -p | nc localhost 9092 | hexdump -C
- 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