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

Implement Backpressure pattern #3233

Open
6 tasks
iluwatar opened this issue Mar 30, 2025 · 1 comment
Open
6 tasks

Implement Backpressure pattern #3233

iluwatar opened this issue Mar 30, 2025 · 1 comment

Comments

@iluwatar
Copy link
Owner

Description

Backpressure is a mechanism used in reactive or streaming systems to prevent overwhelm by controlling the flow of data from producers to consumers. When a consumer cannot process data quickly enough, it signals the producer to slow down or buffer output. This ensures the system remains stable under high load and avoids excessive memory usage or dropped messages.

Key Elements

  • Reactive Streams: In Java, frameworks like Project Reactor or RxJava implement backpressure with APIs allowing consumers to request data at a sustainable rate.
  • Flow Control: Producers honor the consumer’s demand by sending data only as requested.
  • Buffering & Throttling: If the consumer is busy, the producer may buffer data or reduce emission rate.
  • Stability & Resilience: Helps prevent overproduction, out-of-memory errors, and overall system degradation under heavy load.

References

  1. Reactive Streams Specification
  2. Project Reactor Reference Guide (Backpressure)
  3. Java Design Patterns – Contribution Guidelines

Acceptance Criteria

  • Create a new module or package named backpressure (or similar).
  • Implement a simple producer-consumer flow illustrating how backpressure prevents overload.
  • Demonstrate how a consumer can signal demand and how a producer respects that demand.
  • Provide a README (or .md file) explaining the pattern and code architecture, along with diagrams if needed.
  • Include tests showcasing the system’s behavior under normal and high load.
  • Ensure compliance with project style and that all CI checks pass.
@sanurah
Copy link
Contributor

sanurah commented Apr 2, 2025

@iluwatar can you assign this to me please?

@iluwatar iluwatar moved this from Todo to In Progress in Java Design Patterns project Apr 5, 2025
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

2 participants