{"id":13565305,"url":"https://github.com/berndruecker/flowing-retail","last_synced_at":"2025-05-15T16:03:27.266Z","repository":{"id":25186658,"uuid":"103392636","full_name":"berndruecker/flowing-retail","owner":"berndruecker","description":"Sample application demonstrating an order fulfillment system decomposed into multiple independant components (e.g. microservices). Showing concrete implementation alternatives using e.g. Java, Spring Boot, Apache Kafka, Camunda, Zeebe, ...","archived":false,"fork":false,"pushed_at":"2024-08-01T21:26:31.000Z","size":39259,"stargazers_count":1317,"open_issues_count":9,"forks_count":471,"subscribers_count":110,"default_branch":"master","last_synced_at":"2025-04-07T20:12:02.809Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/berndruecker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2017-09-13T11:41:51.000Z","updated_at":"2025-04-07T07:11:50.000Z","dependencies_parsed_at":"2024-12-05T13:02:54.613Z","dependency_job_id":"9d9f4d2f-03fa-42a4-88ad-d818de633799","html_url":"https://github.com/berndruecker/flowing-retail","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berndruecker%2Fflowing-retail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berndruecker%2Fflowing-retail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berndruecker%2Fflowing-retail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berndruecker%2Fflowing-retail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/berndruecker","download_url":"https://codeload.github.com/berndruecker/flowing-retail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254374401,"owners_count":22060609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-01T13:01:44.205Z","updated_at":"2025-05-15T16:03:27.248Z","avatar_url":"https://github.com/berndruecker.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# Flowing Retail\n\nThis sample application demonstrates a simple order fulfillment system, decomposed into multiple independent components (like _microservices_).\n\nThe repository contains code for multiple implementation alternatives to allow a broad audience to understand the code and to compare alternatives. The [table below](#alternatives) lists these alternatives.\n\nThe example respects learnings from **Domain Driven Design (DDD)**, Event Driven Architecture (EDA) and **Microservices (µS)** and is designed to give you hands-on access to these topics.\n\n**Note:** The code was written in order to be explained. Hence, I favored simplified code or copy \u0026 paste over production-ready code with generic solutions. **Don't consider the coding style best practice! It is purpose-written to be easily explainable code**.\n\nYou can find more information on the concepts in the [Practical Process Automation](https://processautomationbook.com/) book with O'Reilly.\n\nFlowing retail simulates a very easy order fulfillment system:\n\n![Events and Commands](docs/workflow-in-service.png)\n\n\u003ca name = \"alternatives\"\u003e\u003c/a\u003e\n\n## Architecture and implementation alternatives\n\nThe most fundamental choice is to select the **communication mechanism**:\n\n* **[Apache Kafka](kafka/)** as event bus (could be easily changed to messaging, e.g. RabbitMQ): [](docs/architecture.png)\n* **[REST](rest/)** communication between Services.\n  * This example also shows how to do **stateful resilience patterns** like **stateful retries** leveraging a workflow engine.\n* **[Zeebe](zeebe/)** broker doing work distribution.\n\nAfter the communication mechanism, the next choice is the **workflow engine**:\n\n* **Camunda 8 (aka Zeebe)**\n\nand the **programming language**:\n\n* **Java**\n\n## Storyline\n\nFlowing retail simulates a very easy order fulfillment system. The business logic is separated into the services shown above (shown as a [context map](https://www.infoq.com/articles/ddd-contextmapping)).\n\n### Long running services and orchestration\n\nSome services are **long running** in nature - for example: the payment service asks customers to update expired credit cards. A workflow engine is used to persist and control these long running interactions.\n\n### Workflows live within service boundaries\n\nNote that the state machine (_or workflow engine in this case_) is a library used **within** one service. If different services need a workflow engine they can  run whatever engine they want. This way it is an autonomous team decision if they want to use a framework, and which one:\n\n![Events and Commands](docs/workflow-in-service.png)\n\n\n\n## Links and background reading\n\n* [Practical Process Automation](https://processautomationbook.com/) book\n* Introduction blog post: https://blog.bernd-ruecker.com/flowing-retail-demonstrating-aspects-of-microservices-events-and-their-flow-with-concrete-source-7f3abdd40e53\n* InfoQ-Writeup \"Events, Flows and Long-Running Services: A Modern Approach to Workflow Automation\": https://www.infoq.com/articles/events-workflow-automation\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberndruecker%2Fflowing-retail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberndruecker%2Fflowing-retail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberndruecker%2Fflowing-retail/lists"}