Skip to content

Add Circuit Breaker Support via Resilience4j #85

@acltabontabon

Description

@acltabontabon

Problem Context

Integrations with external APIs like OpenWealth are inherently unreliable: network hiccups, upstream downtime, or high latency can lead to degraded user experiences or system-wide issues. Without protection, a temporary failure in a single OpenWealth endpoint could:

  • Cause cascading failures across dependent systems
  • Saturate threads and resources due to slow or repeated retries

The library should provide built-in safeguards to shield consumers from these failures, particularly circuit breakers to stop calling failing APIs until they stabilize.

Solution

Integrate Resilience4j into the starter to wrap OpenWealth API operations with circuit breakers.

Design Points:

  • Circuit breakers will be enabled by default for all OpenWealth service operations (e.g., fetch, submit, fetchAsync, submitAsync)
  • Each service bean (CustomerService, CustodyService, OrderPlacementService) will use per-operation circuit breaker instances (e.g., customer.fetch, orderPlacement.submit)
  • Developers can override or disable resilience behavior via configuration
  • Fallbacks will return a Result.failure(...) with appropriate messaging, rather than throwing raw exceptions
  • Leverage Resilience4j’s annotations or programmatic decorators

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions