[Proposal] Support for requesting dedicated thread pool for concurrent message pumping in Non-Session Processor instances #41996
+138
−29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
Non-session Processor
uses the global shared Reactor scheduler to pump messages, this is fine in most cases.But there are cases where customers run a lot of
Non-session Processor
s on a machine (e.g. 50 clients) and in such cases all Processor instances share global shared pool scoped to JVM. This creates challenges for users because –If we look at the
Session Processor
, this is not an issue as each session internally gets its own dedicated pool, and session processor never used global thread pool.This is a proposal to allow users to request dedicated thread pool for each
Non session Processor
instance. Library can internally manage this pool similarly to how it is done in the session case. This could be achieved by adding an overload for maxConcurrentCalls(..) inNon session Processor
builder -For most of the users, this suffices their need and is simple – it hides the internals of pool, and the library manages the lifetime and cleaning up of the pool, aligns with how pools are managed in session processor.