{"id":13990619,"url":"https://github.com/ing-bank/baker","last_synced_at":"2025-04-14T08:57:20.991Z","repository":{"id":37768908,"uuid":"75624797","full_name":"ing-bank/baker","owner":"ing-bank","description":"Orchestrate microservice-based process flows","archived":false,"fork":false,"pushed_at":"2025-03-25T16:19:34.000Z","size":174786,"stargazers_count":341,"open_issues_count":50,"forks_count":83,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-07T02:07:48.205Z","etag":null,"topics":["functions-as-a-service","hacktoberfest","microservices","orchestration","petri-net","scala","serverless"],"latest_commit_sha":null,"homepage":"https://ing-bank.github.io/baker/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ing-bank.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}},"created_at":"2016-12-05T12:56:57.000Z","updated_at":"2025-03-30T00:43:17.000Z","dependencies_parsed_at":"2023-02-13T00:46:23.434Z","dependency_job_id":"6d3ed888-255b-41d6-acab-0ed243c0b340","html_url":"https://github.com/ing-bank/baker","commit_stats":null,"previous_names":[],"tags_count":71,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ing-bank%2Fbaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ing-bank%2Fbaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ing-bank%2Fbaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ing-bank%2Fbaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ing-bank","download_url":"https://codeload.github.com/ing-bank/baker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248852122,"owners_count":21171839,"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":["functions-as-a-service","hacktoberfest","microservices","orchestration","petri-net","scala","serverless"],"created_at":"2024-08-09T13:03:01.347Z","updated_at":"2025-04-14T08:57:20.960Z","avatar_url":"https://github.com/ing-bank.png","language":"Scala","funding_links":[],"categories":["Scala","微服务库","hacktoberfest"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://github.com/ing-bank/baker/blob/master/baker-logo.png?raw=true\" alt=\"Baker Logo\"\u003e\n\n[![Build Status](https://github.com/ing-bank/baker/actions/workflows/ci.yml/badge.svg)](https://github.com/ing-bank/baker/actions/workflows/ci.yml)\n[![Maven Central](https://img.shields.io/maven-central/v/com.ing.baker/baker-runtime_2.13.svg?label=Maven%20Central\u0026logo=apachemaven)](https://search.maven.org/artifact/com.ing.baker/baker-runtime_2.13)\n[![Code Coverage Status](https://codecov.io/gh/ing-bank/baker/graph/badge.svg)](https://codecov.io/gh/ing-bank/baker)\n\u003c/div\u003e\n\n# Baker\n\nBaker is a library that provides a simple and intuitive way to orchestrate microservice-based process flows.\n\nYou declare your orchestration logic as a recipe using the Java, Kotlin, or Scala DSL. A recipe consists of\n`interactions` (system calls), `ingredients` (data), and `events`.\n\nBakers ability to visualize recipes provides a powerful communication tool that helps product owners, architects, and\nengineers to have a common understanding of the business process. This feature allows you to easily share your recipe\nwith others, enabling collaboration and feedback.\n\nBaker allows for the reuse of common interactions across different recipes, promoting consistency and reducing\nduplication. With Baker, you can quickly assemble complex process flows by reusing pre-existing building blocks that\nhave been built by other teams within your company.\n\nUse the list below to learn more about Baker:\n\n- [Documentation](https://ing-bank.github.io/baker/)\n    - [Concepts](https://ing-bank.github.io/baker/sections/concepts/): high level concepts and terminology\n    - [Recipe DSL](https://ing-bank.github.io/baker/sections/cookbook/recipe-dsl/): how to use the recipe DSL\n    - [Visualization](https://ing-bank.github.io/baker/sections/cookbook/visualizations/): how to visualize a recipe\n- [Baker Talk @ J-Fall 2021](https://www.youtube.com/watch?v=U4aCUT9zIFk): API orchestration taken to the next level\n\n## A bird's-eye view of Baker\n\nA recipe is the blueprint of your business process. To create this blueprint you use the Java, Kotlin, or Scala DSL. The\nexamples below demonstrate a recipe for a simple web shop process.\n\n\u003cdetails\u003e\n    \u003csummary\u003eJava DSL\u003c/summary\u003e\n\n```java\nfinal Recipe recipe=new Recipe(\"Web shop\")\n        .withSensoryEvents(\n        CustomerInfoReceived.class,\n        OrderPlaced.class,\n        PaymentMade.class\n    )\n            .withInteractions(\n            InteractionDescriptor.of(ValidateOrder.class),\n        InteractionDescriptor.of(ReserveItems.class)\n        .withRequiredEvent(PaymentMade.class),\n        InteractionDescriptor.of(ShipGoods.class),\n        InteractionDescriptor.of(SendInvoice.class)\n        .withRequiredEvent(GoodsShipped.class)\n        )\n        .withDefaultFailureStrategy(\n        new RetryWithIncrementalBackoffBuilder()\n        .withInitialDelay(Duration.ofMillis(100))\n        .withDeadline(Duration.ofHours(24))\n        .withMaxTimeBetweenRetries(Duration.ofMinutes(10))\n        .build());\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eKotlin DSL\u003c/summary\u003e\n\n```kotlin\nval recipe = recipe(\"Web shop\") {\n    sensoryEvents {\n        event\u003cCustomerInfoReceived\u003e()\n        event\u003cOrderPlaced\u003e()\n        event\u003cPaymentMade\u003e()\n    }\n    interaction\u003cValidateOrder\u003e()\n    interaction\u003cReserveItems\u003e {\n        requiredEvents {\n            event\u003cPaymentMade\u003e()\n        }\n    }\n    interaction\u003cShipGoods\u003e()\n    interaction\u003cSendInvoice\u003e {\n        requiredEvents {\n            event\u003cGoodsShipped\u003e()\n        }\n    }\n    defaultFailureStrategy = retryWithIncrementalBackoff {\n        initialDelay = 100.milliseconds\n        until = deadline(24.hours)\n        maxTimeBetweenRetries = 10.minutes\n    }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eScala DSL\u003c/summary\u003e\n\n```scala\nval recipe: Recipe = Recipe(\"Web shop\")\n  .withSensoryEvents(\n    Event[CustomerInfoReceived],\n    Event[OrderPlaced],\n    Event[PaymentMade]\n  )\n  .withInteractions(\n    ValidateOrder,\n    ReserveItems\n      .withRequiredEvent(Event[PaymentMade])\n      ShipGoods,\n    SendInvoice\n      .withRequiredEvent(goodsShipped)\n  )\n  .withDefaultFailureStrategy(\n    RetryWithIncrementalBackoff\n      .builder()\n      .withInitialDelay(100 milliseconds)\n      .withUntil(Some(UntilDeadline(24 hours)))\n      .withMaxTimeBetweenRetries(Some(10 minutes))\n      .build()\n  )\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eVisualization\u003c/summary\u003e\n\nEvents are gray, ingredients orange, and interactions lilac:\n\n![](docs/images/webshop.svg)\n\n\u003c/details\u003e\n\n## Getting Started\n\nBaker is released to [Maven Central](https://search.maven.org/search?q=g:com.ing.baker). To use Baker you need three\nmodules.\n\n1. recipe-dsl: DSL to describe recipes in a declarative manner\n2. compiler: Compiles recipes into models the runtime can execute\n3. runtime: The runtime to manage and execute recipes\n\n\u003e **Note**\n\u003e If you want to use the Kotlin DSL add `baker-recipe-dsl-kotlin_2.13` instead of `baker-recipe-dsl_2.13`.\n\n### Maven\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.ing.baker\u003c/groupId\u003e\n    \u003cartifactId\u003ebaker-recipe-dsl_2.13\u003c/artifactId\u003e\n    \u003cversion\u003e4.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.ing.baker\u003c/groupId\u003e\n    \u003cartifactId\u003ebaker-compiler_2.13\u003c/artifactId\u003e\n    \u003cversion\u003e4.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.ing.baker\u003c/groupId\u003e\n    \u003cartifactId\u003ebaker-runtime_2.13\u003c/artifactId\u003e\n    \u003cversion\u003e4.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\n```groovy\nimplementation 'com.ing.baker:baker-recipe-dsl_2.13:4.1.0'\nimplementation 'com.ing.baker:baker-compiler_2.13:4.1.0'\nimplementation 'com.ing.baker:baker-runtime_2.13:4.1.0'\n```\n\n### Scala SBT\n\nBaker gets compiled and released for both 2.13.\n\n```scala\nlibraryDependencies += \"com.ing.baker\" % \"baker-recipe-dsl_2.13\" % \"4.1.0\"\nlibraryDependencies += \"com.ing.baker\" % \"baker-compiler_2.13\" % \"4.1.0\"\nlibraryDependencies += \"com.ing.baker\" % \"baker-runtime_2.13\" % \"4.1.0\"\n```\n\n## Contributing\n\nWe welcome your contributions! The simplest way to contribute to Baker is by creating a branch from a fork. You can then\ncreate a pull request on GitHub from your branch.\n\n### Compile and test\n\nTo compile and test all libraries:\n\n```bash\nsbt \n\u003e compile\n\u003e test\n```\n\nTo cross compile all libraries for Scala 2.12 and 2.13:\n\n```bash\nsbt\n\u003e +compile\n\u003e +test\n```\n\n### Compile or test a single project\n\nTo build a single project (baker-akka-runtime, baker-anotations, etc...):\n\n1. Find the name of the project by running:\n\n```bash\nsbt \n\u003e projects\n```\n\n2. Open the desired project via `sbt`:\n\n```bash\nsbt\n\u003e project \u003cPROJECT_NAME\u003e\n\u003e compile\n\u003e test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fing-bank%2Fbaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fing-bank%2Fbaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fing-bank%2Fbaker/lists"}