---
name: spring-boot-microservices-712e72cfe3e6
description: Standards for Feign clients and asynchronous messaging with Spring Cloud Stream. Use when implementing Feign HTTP clients or async event messaging in Spring Boot microservices.
metadata:
  triggers:
    files:
    - '**/*Client.java'
    - '**/*Consumer.java'
    keywords:
    - feign-client
    - spring-cloud-stream
    - rabbitmq
    - resilience4j
---
# Spring Boot Microservices Standards

## **Priority: P0 (CRITICAL)**

## Implementation Guidelines

### Sync Communication (REST & API Interface)

- **Clients**: Use Spring Cloud OpenFeign or HTTP Interfaces (Spring 6/Java 21).
- **Resilience**: Implement Resilience4j with Circuit Breaker, Retry (Exponential Backoff), and RateLimiter.
- **Contracts**: Share DTO Records via Maven BOM or API Contract module.
- **Tracing**: Ensure Micrometer propagation for Distributed Tracing.

See [implementation examples](references/implementation.md) for Feign client with Circuit Breaker fallback.

### Async Communication (Spring Cloud Stream)

- **Architecture**: Use Message-Driven patterns with Spring Cloud Stream.
- **Functions**: Define message handlers as `java.util.function.Function`, `Consumer`, or `Supplier`.
- **Serialization**: Use JSON or Avro for events.
- **Reliability**: Implement Dead Letter Queues (DLQ) and idempotent consumers.

See [implementation examples](references/implementation.md) for Spring Cloud Stream event consumer with idempotency.

### Data & Isolation

- **DB per Service**: NEVER share databases between microservices.
- **Shared Libs**: Minimize shared logic to shared DTOs/Clients only.
- **Discovery**: Use Spring Cloud Gateway for routing and auth.

## Anti-Patterns

- **No Shared DB**: Services must communicate via APIs or Events only.
- **No Shared Entities**: Share DTOs via Maven BOM, never JPA entities.
- **No Sync Call Chains**: Use async messaging to prevent distributed monolith.

## References

- [Implementation Examples](references/implementation.md)

---
Source attribution: HoangNguyen0403
Original project: https://github.com/HoangNguyen0403/agent-skills-standard
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2026 Gabriel Moreira

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: HoangNguyen0403
Original project: https://github.com/HoangNguyen0403/agent-skills-standard
Attribution basis: Upstream repository explicitly recorded in package mirror path

Fields of work: Development & Engineering
Roles: Backend Developer, Data Engineer, DevOps / SRE
Specialties: Backend
Tools: Rabbitmq, Resilience4J, Spring Cloud
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 6845551d75f484e2a24ebb0d00ed47227c895183459677ddc050492cf36eba07
