giuseppe-trisciuoglio avatar

Spring Boot Saga Pattern

This handles distributed transactions across microservices without the coordination overhead of two-phase commit. You get implementations for both choreography (event-driven with Kafka or RabbitMQ) and orchestration (centralized coordinator), with the key insight that every forward transaction needs an idempotent compensating action. The approach maps out transaction flows like Order → Payment → Inventory with corresponding Cancel → Refund → Release paths. Best suited when you're past the monolith stage and need eventual consistency across services that can't share a database. The emphasis on idempotency and persistent saga state is right, because in distributed systems things will fail and retry constantly.

skills.sh installs
3.9K
GitHub stars
369
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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

Sponsors

Details

Repository
github.com/giuseppe-trisciuoglio/developer-kit
Categories
Automation & Workflows, Java & JVM
First seen
May 16, 2026

More from giuseppe-trisciuoglio/developer-kit

All 102
1benjaminsehl avatarshopify-liquid-themesbenjaminsehl/liquid-skillsGenerate Shopify Liquid theme code (sections, blocks, snippets) with correct schema JSON, LiquidDoc headers, translation keys, and CSS/JS patterns. Use when cre3.9Kskills.sh installs
2giuseppe-trisciuoglio avatarnextjs-data-fetchinggiuseppe-trisciuoglio/developer-kitProvides Next.js App Router data fetching patterns including SWR and React Query integration, parallel data fetching, Incremental Static Regeneration (ISR), rev3.9Kskills.sh installs
3zc277584121 avatarjupyter-notebook-writingzc277584121/marketing-skillsWrite Milvus application-level Jupyter notebook examples using a Markdown-first workflow with jupyter-switch for format conversion.3.9Kskills.sh installs
4giuseppe-trisciuoglio avatarunit-test-scheduled-asyncgiuseppe-trisciuoglio/developer-kitProvides patterns for unit testing Spring `@Scheduled` and `@Async` methods using JUnit 5, CompletableFuture, Awaitility, and Mockito. Covers mocking task execu3.9Kskills.sh installs
5mvanhorn avatarpp-espnmvanhorn/printing-press-libraryUse this skill whenever the user asks about live sports scores, standings, team stats, game summaries (with box score, leaders, scoring plays, odds, and win pro3.9Kskills.sh installs
6giuseppe-trisciuoglio avatarlangchain4j-ai-services-patternsgiuseppe-trisciuoglio/developer-kitProvides patterns to build declarative AI Services with LangChain4j for LLM integration, chatbot development, AI agent implementation, and conversational AI in 3.9Kskills.sh installs