microservices-patterns

Implement Resilience4j circuit breakers, retries, and outbox publishing for Java 21 Spring Boot microservices.

Updated Feb 25, 2026
One-click install
npx skills add https://github.com/zenobiuszeto/banking-strawman-capabilities --skill microservices-patterns-zenobiuszeto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: microservices-patterns
Source: https://github.com/zenobiuszeto/banking-strawman-capabilities/tree/main/skills/microservices-patterns
Command: npx skills add https://github.com/zenobiuszeto/banking-strawman-capabilities --skill microservices-patterns-zenobiuszeto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a production-ready blueprint for preventing and recovering from distributed-systems failures in Java 21 / Spring Boot microservices, reducing lost transactions, inconsistent state, and downtime caused by unreliable networks and dependent services.

Core Features & Use Cases

  • Resilience Patterns: Circuit Breaker, Retry, Bulkhead, and Rate Limiter using Resilience4j to protect downstream calls and provide safe fallbacks.
  • Distributed Transactions & Reliability: Saga orchestration with compensating transactions for cross-service flows and an Outbox pattern to guarantee atomic DB write + Kafka publish.
  • Architecture Patterns: CQRS for separate read/write models and projection builders, idempotency keys to deduplicate client retries, and distributed locks (Redisson) to prevent concurrent state corruption.
  • Observability & Operational Rules: Guidance for Actuator health, OpenTelemetry tracing, and critical operational rules (fallback semantics, idempotency TTLs, consistent locking order, and chaos testing).
  • Use Cases: Securely orchestrating account onboarding with initial deposit, ensuring transaction events are published exactly once, and protecting payment calls to external ledgers.

**Quick Start

Use the microservices-patterns skill to add Resilience4j circuit breakers and retries, transactional outbox publishing to Kafka, saga orchestration, and idempotency handling to a Spring Boot payment service.

Frequently Asked Questions about microservices-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a transactional outbox pattern with Kafka in Spring Boot?

To implement the transactional outbox pattern in Spring Boot, you write events to an outbox table within the same database transaction as your domain state, then a separate process reads and publishes those events to Kafka, guaranteeing atomic DB write and message delivery.

How do I handle distributed transactions and compensating actions in Java microservices?

You handle distributed transactions using saga orchestration, which coordinates cross-service flows in Java microservices and automatically triggers compensating transactions to undo previous steps when a downstream service failure occurs.

What is the best way to prevent duplicate processing from client retries in Spring Boot?

Implement idempotency keys to deduplicate client retries in Spring Boot by storing unique request identifiers with a specified TTL, ensuring that repeated requests from network failures do not result in duplicate side effects or state corruption.

How do I add Resilience4j circuit breakers and rate limiting to a Spring Boot microservice?

To add Resilience4j circuit breakers and rate limiting to Spring Boot, you apply Resilience4j annotations to inter-service call points, configuring thresholds that trip the breaker to stop cascading failures and limit concurrent requests via bulkheads.

Can I use Redisson distributed locks to prevent concurrent state corruption in Java microservices?

Redisson distributed locks prevent concurrent state corruption in Java microservices by acquiring mutually exclusive locks across distributed nodes, ensuring safe access to shared resources and preventing concurrent modifications.

How do CQRS projections work with separate read and write models in Spring Boot?

CQRS projections in Spring Boot separate read and write models by using projection builders to consume domain events and update tailored read models, allowing you to optimize queries independently from transactional write logic.