Grokking Microservices Design Patterns
Vote

0% completed

Saga Pattern: An Example

Here is the Saga Pattern in Java. We will build a simple online shopping example with two services: the Order Service and the Inventory Service.

The Example System

Consider an online shop. A customer adds items to a cart and checks out, which creates an order. The Inventory Service then checks if the items are available. If yes, it updates the inventory, and the order is completed. If not, the order is cancelled. Seems simple, right? Internally, it is a good fit for the Saga Pattern.

Defining the Services

We will first define our services

.....

.....

.....

Like the course? Get enrolled and start learning!
Sila Setthakan-anan

Sila Setthakan-anan

· 2 years ago

Anyone can demo the Choreography approach and Saga Log when service stop working on the fly in Java?