Orchestration based Saga Pattern for microservices with Camunda

Photo by Omar Flores on Unsplash
  1. Choreography: In choreography a local transaction publishes a domain event which triggers local transaction in other services.
  2. Orchestration: In orchestration, there will be a centralized controller which tells the participants which local transactions to execute.

Demo application

  • This is a very simple application where all these four services are performing their domain specific operations.
  • Then Camunda engine is used to perform the orchestration.
  • There is another dotnet based API: camunda-helper which has implemented all the handlers which are used by Camunda to perform the operations. These handlers in turn call the respective (domain specific) microservices. In Camunda we can define the process using BPMN which simplifies creating business process very easy. To know more about it please check these articles by me: Camunda basics part1 & part2.
  • Run the ‘docker-compose.yml present under ‘camunda.demo.process/ms-saga-demo/’ to start all the microservices instances.
  • You can run all of them on local machine too. (Check the port number which is exposed and use the same in ‘camunda-helper’ API solution).
  • Run the camunda-helper API which opens the swagger page.
  • Choose the option ‘Process_Transaction_Saga_Orchestrator’ to start the process (This mimics that one order has came for processing). To demonstrate the capabilities, I am throwing exceptions from all the local transactions (which is randomly generated based on no 1 to 4). You need to run the process multiple times to see different flows.

Software Engineer | Backend Specialist | System Architect | Cloud Native Apps | DOTNET, PYTHON | https://www.linkedin.com/in/satyampushkar/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Cloud Foundry Advisory Board Meeting, Apr 2020: Paketo Buildpacks

Creating AWS instance and providing EBS volume through CLI

Simple API Explanation and Examples (+ an easy to understand Infographic)

Have time to participate in the 2nd round of the DEXE 150k anniversary marathon!

Reagent component from scratch: Definition Table

Analysis of Algorithms

Meet the Kotlin community at Dynatrace

Hello! I am Harshita Patel.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Satyam Pushkar

Satyam Pushkar

Software Engineer | Backend Specialist | System Architect | Cloud Native Apps | DOTNET, PYTHON | https://www.linkedin.com/in/satyampushkar/

More from Medium

Choreography based Saga Pattern using dotnet 6

Attribute-Based Access Control in a Microservices Architecture

Micro Frontends ….future of Software development

Micro Service Architecture — Design Patterns (Decomposition Pattern)