reactor / reactor-core

Non-Blocking Reactive Foundation for the JVM

Home Page:http://projectreactor.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Suggestion] Dynamic Concurrency Control in flatMap for External System Calls

AChekroun opened this issue · comments

Motivation

When dealing with external system calls, it's common to use flatMap. However, a challenge arises when these external systems become potential bottlenecks. The core of the issue is the need to dynamically manage the concurrency of the flatMap operator to prevent overloading these systems.

Currently, I employ libraries like Resilience4j's Bulkhead or Netflix's concurrency-limits to manage this. These solutions, while effective in some cases, have a significant drawback: they throw RejectedExecutionException when overloaded. This exception handling fails to signal the upstream publisher in the reactive stream to reduce the request rate, leading to an ineffective management of backpressure.

Desired solution

Having a flatmap with dynamic concurrency or rateLimiter with dynamic value

Thanks for your time

Can you please provide a minimum example project as an attached zip or a repository where the limitations of the current design can be observed?

@AChekroun it's been a week since my last request for details, we will consider closing this issue if there's no feedback in a week from now, however feel free to re-open whenever you find the time to provide more details.

Closing as per the above. Feel free to reopen once you have an example project to share.