# kafka-demo **Repository Path**: lovecross/kafka-demo ## Basic Information - **Project Name**: kafka-demo - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-12 - **Last Updated**: 2025-09-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Kafka FastAPI Demo A FastAPI application demonstrating Kafka integration. ## Features - Send messages to Kafka topics - Consume messages from Kafka topics - View consumed messages via API - Check Kafka service status ## Requirements - Python 3.8+ - Docker (for Kafka) - Kafka running locally (see `docker-compose.yml`) ## Installation 1. Clone the repository 2. Install dependencies: ```bash pip install -r requirements.txt ``` 3. Start Kafka services: ```bash docker-compose up -d ``` 4. Run the FastAPI application: ```bash uvicorn main:app --reload ``` ## API Endpoints - `POST /kafka/send` - Send message to Kafka - `POST /kafka/consume/start` - Start consuming messages - `GET /kafka/messages` - Get consumed messages - `GET /kafka/topics` - List available topics - `GET /kafka/status` - Check Kafka connection status ## Usage 1. Access the interactive docs at `http://localhost:8000/docs` 2. Send messages using the `/kafka/send` endpoint 3. Start consuming messages with `/kafka/consume/start` 4. View consumed messages at `/kafka/messages` ## Development ```bash # Run tests pytest # Format code black . # Lint code flake8 ``` ## License MIT