iluwatar / java-design-patterns

Design patterns implemented in Java
https://java-design-patterns.com
Other
88.32k stars 26.21k forks source link

Timeout pattern #2845

Open iluwatar opened 3 months ago

iluwatar commented 3 months ago

Description: The Timeout design pattern is crucial in a microservices architecture to handle latency and prevent cascading failures. By setting a timeout, we can avoid long waits for responses from dependent services, improving overall system resilience and performance. This pattern helps in defining a period within which a service call must complete, otherwise, it gets aborted and a fallback mechanism is triggered. This implementation is particularly important for maintaining the robustness of the system under heavy load or when some services are down or slow to respond.

Main Elements of the Pattern:

References:

  1. Microservices Patterns
  2. Resilience4j - TimeLimiter
  3. Project Contribution Guidelines
  4. Timeout pattern

Acceptance Criteria: