Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout pattern #2845

Open
iluwatar opened this issue Mar 24, 2024 · 4 comments
Open

Timeout pattern #2845

iluwatar opened this issue Mar 24, 2024 · 4 comments

Comments

@iluwatar
Copy link
Owner

iluwatar commented Mar 24, 2024

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:

  • Timeout Duration: Defines the maximum time a service call is allowed to take.
  • Fallback Mechanism: Provides a default response or alternative workflow if a service call times out.
  • Configuration: Ability to configure different timeouts for different services based on their response times.
  • Logging and Monitoring: Capture timeout events for monitoring and debugging purposes.
  • Circuit Breaker Integration: Work in conjunction with the Circuit Breaker pattern to prevent repeated calls to failing services.

References:

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

Acceptance Criteria:

  • Implement a configurable timeout for service calls.
  • Provide a fallback mechanism for timed-out calls.
  • Ensure the timeout duration can be configured per service.
  • Log timeout events for further analysis and monitoring.
  • Demonstrate the pattern with a practical example within the existing microservices.
  • Ensure the implementation follows the project's contribution guidelines and coding standards.
@iluwatar iluwatar converted this from a draft issue Mar 24, 2024
@iluwatar iluwatar changed the title Implement Timeout Design Pattern Timeout pattern Jun 1, 2024
@kanishkawithanawasam
Copy link

kanishkawithanawasam commented Aug 1, 2024

Hello,

I am a third-year undergraduate computer science student. I am new to this project and would like to contribute. I will be working on this issue.

Copy link

stale bot commented Oct 5, 2024

This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status: stale issues and pull requests that have not had recent interaction label Oct 5, 2024
@stale stale bot removed the status: stale issues and pull requests that have not had recent interaction label Oct 13, 2024
@iluwatar iluwatar added info: help wanted status: stale issues and pull requests that have not had recent interaction labels Oct 13, 2024
@stale stale bot removed the status: stale issues and pull requests that have not had recent interaction label Oct 13, 2024
@Sinclo
Copy link

Sinclo commented Oct 16, 2024

Hi @iluwatar . I would be interested in taking on this issue. Please assign this to me.
Thank you!

@iluwatar iluwatar moved this from Todo to In Progress in Java Design Patterns project Nov 3, 2024
@rana7azem
Copy link

Hi @iluwatar , I’m interested in working on this issue. Could you please assign it to me? Thank you!

@iluwatar iluwatar assigned rana7azem and unassigned Sinclo Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

4 participants