跳转到主要内容
此内容尚未提供您的语言版本,正在以英文显示。

Saga Orchestration

技能 已验证 活跃
属于:Agents

Implement saga patterns for distributed transactions and cross-aggregate workflows. Use this skill when implementing distributed transactions across microservices where 2PC is unavailable, designing compensating actions for failed order workflows that span inventory, payment, and shipping services, building event-driven saga coordinators for travel booking systems that must roll back hotel, flight, and car rental reservations atomically, or debugging stuck saga states in production where compensation steps never complete.

目的

To provide a robust and well-documented framework for implementing saga patterns, enabling reliable distributed transactions and cross-aggregate workflows in microservices architectures.

功能

  • Saga pattern implementation (orchestration and choreography)
  • Automated compensation logic for failures
  • Per-step timeout configuration
  • Idempotency guards for commands and compensations
  • Production monitoring setup with Prometheus metrics
  • DLQ recovery patterns for compensation failures

使用场景

  • Coordinating multi-service transactions without distributed locks
  • Implementing compensating transactions for partial failures
  • Managing long-running business workflows
  • Building atomic order fulfillment, approval, or booking processes
  • Debugging stuck saga states in production

非目标

  • Directly managing participant service implementations
  • Replacing message brokers or event stores
  • Providing synchronous transaction guarantees
  • Handling network-level failures outside of compensated workflows

工作流

  1. Define saga steps (action and compensation)
  2. Configure participant service interactions
  3. Implement idempotency guards
  4. Set up per-step timeouts and retry policies
  5. Monitor saga execution and handle compensation failures
  6. Implement DLQ recovery for persistent compensation issues

实践

  • Idempotency
  • Compensation Design
  • Error Handling
  • Monitoring
  • Asynchronous Communication

先决条件

  • Python runtime
  • Message broker or event bus (e.g., Kafka, RabbitMQ, SQS)
  • Saga store (database)

Code Execution

  • info:LoggingThe advanced patterns section mentions logging state transitions and using correlation IDs, but a dedicated audit log file mechanism is not explicitly detailed in the provided code snippets.

安装

请先添加 Marketplace

/plugin marketplace add wshobson/agents
/plugin install backend-development@claude-code-workflows

质量评分

已验证
98 /100
1 day ago 分析

信任信号

最近提交3 days ago
星标35.3k
许可证MIT
状态
查看源代码

类似扩展

Microservices Patterns

98

Design microservices architectures with service boundaries, event-driven communication, and resilience patterns. Use when building distributed systems, decomposing monoliths, or implementing microservices.

技能
wshobson

Java Architect

100

Use when building, configuring, or debugging enterprise Java applications with Spring Boot 3.x, microservices, or reactive programming. Invoke to implement WebFlux endpoints, optimize JPA queries and database performance, configure Spring Security with OAuth2/JWT, or resolve authentication issues and async processing challenges in cloud-native Spring applications.

技能
jeffallan

Senior Backend Engineer

100

Designs and implements backend systems including REST APIs, microservices, database architectures, authentication flows, and security hardening. Use when the user asks to "design REST APIs", "optimize database queries", "implement authentication", "build microservices", "review backend code", "set up GraphQL", "handle database migrations", or "load test APIs". Covers Node.js/Express/Fastify development, PostgreSQL optimization, API security, and backend architecture patterns.

技能
alirezarezvani

Embedding Strategies

100

Select and optimize embedding models for semantic search and RAG applications. Use when choosing embedding models, implementing chunking strategies, or optimizing embedding quality for specific domains.

技能
wshobson

Aws Cdk Development

100

AWS Cloud Development Kit (CDK) 专家,用于使用 TypeScript/Python 构建云基础设施。在创建 CDK 堆栈、定义 CDK 构造、实现基础设施即代码,或当用户提及 CDK、CloudFormation、IaC、cdk synth、cdk deploy,或希望以编程方式定义 AWS 基础设施时使用。涵盖 CDK 应用结构、构造模式、堆栈组合和部署工作流。

技能
zxkane

Fit Drift Diffusion Model

100

Fit cognitive drift-diffusion models (Ratcliff DDM) to reaction time and accuracy data with parameter estimation (drift rate, boundary separation, non-decision time), model comparison, and parameter recovery validation. Use when modeling binary decision-making with reaction time data, estimating cognitive parameters from experimental data, comparing sequential sampling model variants, or decomposing speed-accuracy tradeoff effects into latent cognitive components.

技能
pjt222