GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - expertjavaguy/saga-coordinator-java: Saga Coordinator sample for long-lived transactions using Kafka as the event stream.

BranchesTags
Open more actions menu

Latest commit

 

History

53 Commits
53 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/ISSUE_TEMPLATE
.github/ISSUE_TEMPLATE
 
 
docs
docs
 
 
images
images
 
 
src
src
 
 
.gitignore
.gitignore
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

Saga Coordinator as a Finite State Machine (FSM) in Java

Background

Coordination is a Saga approach where the coordination logic of business processes (e.g. financial transactions) is centralized in a Saga Coordinator, also known as Reactive Orchestrator. It uses the concept of commands and events, where commands are tasks that need to be done and events are tasks that have been done.

The Saga Coordinator produces commands to an event stream and the respective saga participants consume these commands. These participants produce their events after performing their operations and the coordinator consume these Event.

Saga Coordinator

The Saga Coordinator can be implemented as a Finite State Machine (FSM), where it produces commands and waits for events produced by the participants to drive the flow. Events are represented as nodes, while commands are represented as transitions between nodes.

About the sample

The sample contains an FSM Saga Coordinator using Spring Statemachine as the foundation and Confluent Kafka as the distributed streaming platform. The state machine is built with:

  • Spring Cloud Stream with Kafka binder to allow transparent connectivity with Kafka topics
  • Apache Avro for data serialization and definition of compatile schemas for events and commands
  • Confluent Schema Registry to version and store Avro schemas
  • Redis for the state machine context persistence
  • Azure Cosmos DB (MongoDB API) to persist all payloads used in transitions between nodes

Prerequisites

  • Java JDK 8 or later
  • Maven 3.0 or later
  • Confluent Kafka + Zookeper + Schema Registry services running. If you want to run locally as Docker containers, follow the instructions here.
  • Redis instance running. If you want to run locally as Docker container, follow the instructions here.
  • MongoDB instance running. If you want to run locally as Docker container, follow the instructions here.

Getting Started

The lab is divided in the following steps:

  • Step 1: Understanding the workflow
  • Step 2: Configuring Application Properties
  • Step 3: Build and run as Docker container (WIP)

About

Saga Coordinator sample for long-lived transactions using Kafka as the event stream.

Topics

dockerjavakafkasaga-patternspring-cloud-streamstate-machine

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.