https://github.com/redis-field-engineering/demo-microservices-saga
https://github.com/redis-field-engineering/demo-microservices-saga
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/redis-field-engineering/demo-microservices-saga
- Owner: redis-field-engineering
- Created: 2021-03-06T15:05:24.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-13T12:52:18.000Z (almost 3 years ago)
- Last Synced: 2025-04-12T08:12:44.635Z (about 1 month ago)
- Language: Go
- Size: 71.3 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Microservices Saga Demo
This demo is useful for showing microservices communicating through a Redis Streams messaging bus. It can randomly inject failures that will be cleaned up and retried.
## Running Locally
Set up your microservices flow - See below for configuration infomation
```
# Copy the example microservices flow
cp conf/config.yml.example conf/config.yml```
Use docker-compose
```
docker-compose up
```[Use the Web UI](http://localhost:5010)
[Redis Insight](http://localhost:8088) If using docker-compose add a database with host redis and port 6379 to view in real time
## Configuration Information
```
# Set your redis host - use redis for docker
host: redis
# Set your redis port - use 6379 for docker
port: 6379# create a pipeline of microservices
microservices:
# The initial service - listens on the stream with the name
- name: kickoff
output: step1# The next service in the pipeline
- name: OrderAccepted
input: step1
output: step2
batch_size: 2
# How many messsages to pull from the queue
# at a time - default is 1- name: OrderQueued
input: step2
output: step3
min_proc_ms: 0
max_proc_ms: 2
# Sleep a random amount of ms
# between the min and max to simulate processing time- name: OrderExecuted
input: step3
output: step4
error_rate_percent: 0.2
# Have this pipeline step fail
# a certain percentage of the time
process_count: 3
# this will run three separte OrderExecuted Microservice processes
# The final service
- name: OrderConfirmed
input: step4
```