{"id":25983795,"url":"https://github.com/felixojiambo/message-stream-processor","last_synced_at":"2026-05-03T22:34:14.034Z","repository":{"id":278623160,"uuid":"936228815","full_name":"felixojiambo/Message-Stream-Processor","owner":"felixojiambo","description":"Message Stream Processor is a Spring Boot-based microservice designed to publish and consume messages using Apache Kafka. The project leverages Docker and Kubernetes for containerization and orchestration, providing a scalable and resilient message processing solution.","archived":false,"fork":false,"pushed_at":"2025-02-21T04:51:04.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-22T11:50:38.576Z","etag":null,"topics":["docker","java","jre","kafka","kurbenetes","load-balancer","microservices","nodeport","rest-api","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felixojiambo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-20T18:28:53.000Z","updated_at":"2025-02-21T05:09:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"598586e1-2131-461f-90ac-b2e80a9d1880","html_url":"https://github.com/felixojiambo/Message-Stream-Processor","commit_stats":null,"previous_names":["felixojiambo/message-stream-processor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/felixojiambo/Message-Stream-Processor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixojiambo%2FMessage-Stream-Processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixojiambo%2FMessage-Stream-Processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixojiambo%2FMessage-Stream-Processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixojiambo%2FMessage-Stream-Processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felixojiambo","download_url":"https://codeload.github.com/felixojiambo/Message-Stream-Processor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixojiambo%2FMessage-Stream-Processor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32587821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"ssl_error","status_checked_at":"2026-05-03T22:09:10.534Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","java","jre","kafka","kurbenetes","load-balancer","microservices","nodeport","rest-api","spring-boot"],"created_at":"2025-03-05T10:33:01.831Z","updated_at":"2026-05-03T22:34:14.019Z","avatar_url":"https://github.com/felixojiambo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Message Stream Processor\n\nMessage Stream Processor is a Spring Boot-based microservice that enables message publishing and consumption using Apache Kafka. This project leverages Docker for containerization and Kubernetes for orchestration, providing a scalable solution for real-time messaging.\n\n## Overview\n\nThe Message Stream Processor application is designed to:\n\n- **Publish Messages:** Accept messages via a REST API endpoint and send them to a Kafka topic.\n- **Consume Messages:** Listen to a Kafka topic and process incoming messages.\n- **Handle Errors:** Use a robust error handling mechanism with retry logic and a dead-letter topic.\n- **Deploy Easily:** Use Docker multi-stage builds for optimized images and Kubernetes manifests for seamless deployment.\n\n## Features\n\n- **Spring Boot REST API:** Provides a `/publish` endpoint for message submission.\n- **Kafka Integration:** \n  - **Producer:** Publishes messages to a designated Kafka topic.\n  - **Consumer:** Listens on the Kafka topic and logs or processes messages.\n  - **Error Handling:** Implements an exponential backoff strategy with retries and routes failed messages to a dead-letter topic.\n- **Containerization:** Multi-stage Docker builds utilizing IBM Semeru JDK/JRE for build and runtime optimization.\n- **Kubernetes Support:** YAML manifests for deploying Kafka, Zookeeper, and the Spring Boot application.\n\n## Architecture\n\nThe project is composed of the following layers:\n\n1. **API Layer:**\n   - **MessageController:** Handles incoming HTTP POST requests to publish messages.\n2. **Service Layer:**\n   - **KafkaProducerService:** Manages the publishing of messages to Kafka.\n   - **KafkaConsumerService:** Consumes messages from Kafka and processes them.\n3. **Error Handling:**\n   - Configured via custom error handlers that implement retries and dead-letter routing.\n4. **Infrastructure:**\n   - **Kafka and Zookeeper:** Managed with Docker and Kubernetes.\n   - **Kubernetes Manifests:** Provide configuration for deployments, services, and externalized configuration via ConfigMaps.\n\n## Technologies Used\n\n- **Java 21 (IBM Semeru JDK/JRE)**\n- **Spring Boot**\n- **Apache Kafka**\n- **Docker**\n- **Kubernetes**\n- **Maven**\n- **Lombok**\n\n## Getting Started\n\n### Prerequisites\n\n- **Java 21**\n- **Maven 3.6+**\n- **Docker**\n- **Kubernetes (e.g., minikube, kind, or any managed cluster)**\n- **Kafka and Zookeeper** (can be run via Docker Compose or Kubernetes)\n\n### Building the Application\n\n1. **Clone the Repository:**\n\n   ```bash\n   git clone https://github.com/felixojiambo/Message-Stream-Processor.git\n   cd Message-Stream-Processor\n   ```\n\n2. **Build with Maven:**\n\n   ```bash\n   ./mvnw clean package -DskipTests\n   ```\n\n3. **Build the Docker Image:**\n\n   ```bash\n   docker build -t message-stream-processor:latest .\n   ```\n\n### Running Locally with Docker Compose\n\nUse the provided Docker Compose file to launch Zookeeper, Kafka, and the Message Stream Processor:\n\n```bash\ndocker-compose up\n```\n\n### Deploying on Kubernetes\n\n1. **Apply the ConfigMap:**\n\n   ```bash\n   kubectl apply -f kubernetes/kafka-configmap.yaml\n   ```\n\n2. **Deploy Zookeeper:**\n\n   ```bash\n   kubectl apply -f kubernetes/zookeeper-deployment.yaml\n   kubectl apply -f kubernetes/zookeeper-service.yaml\n   ```\n\n3. **Deploy Kafka:**\n\n   ```bash\n   kubectl apply -f kubernetes/kafka-deployment.yaml\n   kubectl apply -f kubernetes/kafka-service.yaml\n   ```\n\n4. **Deploy the Spring Boot Application:**\n\n   ```bash\n   kubectl apply -f kubernetes/spring-app-deployment.yaml\n   kubectl apply -f kubernetes/spring-app-service.yaml\n   ```\n\n## Usage\n\n- **Publishing a Message:**\n\n  Send a POST request to the `/publish` endpoint with a JSON payload:\n\n  ```json\n  {\n    \"message\": \"Hello, Kafka!\"\n  }\n  ```\n\n  Example using `curl`:\n\n  ```bash\n  curl -X POST http://localhost:80/publish \\\n       -H \"Content-Type: application/json\" \\\n       -d '{\"message\": \"Hello, Kafka!\"}'\n  ```\n\n- **Consuming Messages:**\n\n  The Kafka consumer listens on the configured topic and logs incoming messages. Check the logs to see the processed messages and error handling in action.\n\n## Contributing\n\nContributions are welcome! To get started, fork the repository and submit pull requests with your enhancements or bug fixes. For issues or feature requests, please open an issue on GitHub.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixojiambo%2Fmessage-stream-processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelixojiambo%2Fmessage-stream-processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixojiambo%2Fmessage-stream-processor/lists"}