New advertisers: 50% off your first month with code FIRSTMONTHSee slots
giuseppe-trisciuoglio avatar

Spring Boot Saga Pattern

Saga pattern guidance for Spring Boot microservices covering choreography and orchestration with Kafka or Axon.

skills.sh installs
3.9K
GitHub stars
372
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers the forward transaction flow, compensating transactions, and choosing between choreography and orchestration
  • Includes Kafka configuration, idempotent compensation handlers, saga state persistence, and metrics for stuck or failed sagas
  • Enforces that every forward step has an idempotent compensation and that saga state persists before commands are sent
  • Designed for teams replacing two-phase commit with eventual consistency across Spring Boot services

Install

$ npx -y skills add giuseppe-trisciuoglio/developer-kit --skill spring-boot-saga-pattern -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Spring Boot Saga Pattern

Overview

Implements distributed transactions across microservices using the Saga Pattern. Replaces two-phase commit with a sequence of local transactions and compensating actions. Supports choreography (event-driven) and orchestration (centralized coordinator) approaches with Kafka, RabbitMQ, or Axon Framework.

When to Use

  • Building distributed transactions across multiple microservices
  • Replacing two-phase commit (2PC) with a more scalable solution
  • Handling transaction rollback when a service fails
  • Ensuring eventual consistency in microservices architecture
  • Implementing compensating transactions for failed operations
  • Coordinating complex business processes spanning multiple services

Trigger phrases: distributed transactions, saga pattern, compensating transactions, microservices transaction, eventual consistency, rollback across services, orchestration pattern, choreography pattern

Instructions

1. Design Transaction Flow

Map the sequence of operations and their compensating transactions:

Order → Payment → Inventory → Shipment
  ↓        ↓        ↓          ↓
Cancel  Refund   Release    Cancel

Details

Repository
github.com/giuseppe-trisciuoglio/developer-kit
Category
Backend & APIs
First seen
May 16, 2026

More from giuseppe-trisciuoglio/developer-kit

All 95

Similar to Spring Boot Saga Pattern

More Backend & APIs