{"id":48541908,"url":"https://github.com/jewel-cse/order-processing-pipeline","last_synced_at":"2026-04-08T05:01:26.842Z","repository":{"id":325925138,"uuid":"1098196133","full_name":"Jewel-cse/order-processing-pipeline","owner":"Jewel-cse","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-27T11:32:13.000Z","size":98036,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-27T21:49:50.385Z","etag":null,"topics":["dlq-retry","docker-compose","event-driven","kafka","kafka-consumer","kafka-producer","kstream","ktable","retryable"],"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/Jewel-cse.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-17T11:32:36.000Z","updated_at":"2025-11-27T11:32:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Jewel-cse/order-processing-pipeline","commit_stats":null,"previous_names":["jewel-cse/order-processing-pipeline"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Jewel-cse/order-processing-pipeline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jewel-cse%2Forder-processing-pipeline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jewel-cse%2Forder-processing-pipeline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jewel-cse%2Forder-processing-pipeline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jewel-cse%2Forder-processing-pipeline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jewel-cse","download_url":"https://codeload.github.com/Jewel-cse/order-processing-pipeline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jewel-cse%2Forder-processing-pipeline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31540826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["dlq-retry","docker-compose","event-driven","kafka","kafka-consumer","kafka-producer","kstream","ktable","retryable"],"created_at":"2026-04-08T05:01:23.936Z","updated_at":"2026-04-08T05:01:26.831Z","avatar_url":"https://github.com/Jewel-cse.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Order Processing Pipeline\n\n## 📖 Project Overview\n\nA robust, **event‑driven microservices** example that demonstrates an end‑to‑end order processing flow using **Apache Kafka (KRaft mode, no Zookeeper)**, **Spring Boot 3.5.7**, and **Docker**. The solution showcases resilient messaging patterns such as **retryable topics**, **dead‑letter queues (DLQ)**, and real‑time analytics with **Kafka Streams**.\n\n---\n\n## 📁 Project Structure\n\n```text\norder-processing-pipeline/\n├─ analytics-service/      # Kafka Streams service that aggregates daily spend per customer\n├─ event-contracts/        # Shared DTOs / event schemas\n├─ infrastructure/         # Docker‑Compose for Kafka (KRaft) \u0026 Kafdrop UI\n├─ order-service/          # Producer – REST API to create orders\n├─ payment-service/        # Consumer – processes payments, retries, DLQ handling\n├─ pom.xml                 # Maven parent POM\n└─ README.md               # This documentation\n```\n\n---\n\n## ✨ Key Features\n\n- **Event‑Driven Architecture** – Services communicate asynchronously via Kafka topics.\n- **KRaft Kafka** – Modern Kafka deployment without Zookeeper.\n- **Resiliency** – Automatic retries with configurable back‑off and DLQ for poison messages.\n- **Real‑Time Analytics** – `analytics‑service` uses Kafka Streams to compute daily spend per customer.\n- **Infrastructure as Code** – One‑click Kafka cluster setup via Docker‑Compose.\n- **Observability** – Spring Actuator endpoints and Kafdrop UI for topic inspection.\n\n---\n\n## 🛠️ Tech Stack\n\n| Category | Technology |\n|----------|------------|\n| **JDK** | **Java 21** |\n| **Framework** | **Spring Boot 3.5.7** |\n| **Messaging** | **Apache Kafka 3.x (KRaft mode)** |\n| **Containerisation** | **Docker \u0026 Docker‑Compose** |\n| **Build** | **Maven** |\n| **Testing** | **JUnit 5, Testcontainers** |\n\n---\n\n## ⚙️ Getting Started\n\n### Prerequisites\n\n- **Java 21** (ensure `JAVA_HOME` points to a JDK 21 installation)\n- **Docker Desktop** (running)\n- **Maven** (`mvn` on the PATH)\n\n### Step‑by‑Step\n\n1. **Start the Kafka infrastructure** (KRaft, no Zookeeper)\n   ```bash\n   cd infrastructure\n   docker-compose up -d\n   ```\n   This brings up a single‑node Kafka broker and the Kafdrop UI (http://localhost:9000).\n\n2. **Build all modules**\n   ```bash\n   cd ..   # back to repository root\n   mvn clean install\n   ```\n   Maven compiles the code, runs unit tests, and packages each service.\n\n3. **Run the services** (open three terminals, one per service)\n   ```bash\n   # Terminal 1 – Order Service\n   cd order-service\n   mvn spring-boot:run\n   ```\n   ```bash\n   # Terminal 2 – Payment Service\n   cd payment-service\n   mvn spring-boot:run\n   ```\n   ```bash\n   # Terminal 3 – Analytics Service (optional, for spend queries)\n   cd analytics-service\n   mvn spring-boot:run\n   ```\n\n   ```bash\n   # Terminal 4 – Inventory Service\n   cd inventory-service\n   mvn spring-boot:run\n   ```\n\n---\n\n## 🧪 How to Test\n\n1. **Create Orders (bulk publish, GET request for browser)**\n   ```bash\n   curl -X GET http://localhost:8080/order/create \\\n        -H \"Content-Type: application/json\"\n   ```\n   The endpoint publishes **100** `OrderEvent` messages (customer ID `CUST789012`) to the `order-events` topic and returns the plain‑text response `\"published\"`.\n\n2. **Verify Payment Processing**\n   - Check the logs of `payment-service`; you should see the 100 orders being consumed and payments simulated.\n\n3. **Query Daily Spend (String response)**\n   ```bash\n   curl http://localhost:8081/analytics/daily-spend/CUST789012/2025-11-24\n   ```\n   Expected response (plain string):\n   ```\n   \"Customer CUST789012 spent 1200.0 on 2025-11-24\"\n   ```\n   The endpoint returns a simple string rather than JSON.\n\n4. **Test Failure \u0026 DLQ**\n   ```bash\n   curl -X GET http://localhost:8080/order/create \\\n        -H \"Content-Type: application/json\"\n   ```\n   (The same bulk endpoint will attempt to publish events; if any event triggers a failure in the payment service, it will be retried three times and then moved to the dead‑letter topic `order-events-topic.DLT`). You can inspect the DLQ via Kafdrop:\n   ```bash\n   open http://localhost:9000\n   ```\n\n---\n\n## 🚀 Future Improvements\n\n- **Multi‑node Kafka cluster** with partition \u0026 replica configuration.\n- **Metrics \u0026 Alerting** – Prometheus + Grafana for consumer lag, throughput, error rates.\n- **Schema Registry** – Confluent Schema Registry with Avro/Protobuf for strong contract enforcement.\n- **Kubernetes Deployment** – Helm charts for services and Kafka.\n- **End‑to‑End Test Suite** – Simulate high‑volume event flow using Testcontainers.\n- **Security** – TLS encryption and SASL authentication for Kafka communication.\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! Fork the repository, create a feature branch, and submit a pull request. Ensure all tests pass and follow the existing code style.\n\n---\n\n*Happy coding!*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjewel-cse%2Forder-processing-pipeline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjewel-cse%2Forder-processing-pipeline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjewel-cse%2Forder-processing-pipeline/lists"}