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

[Proposal] Support for requesting dedicated thread pool for concurrent message pumping in Non-Session Processor instances #41996

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anuchandy
Copy link
Member

@anuchandy anuchandy commented Sep 24, 2024

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 Processors 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 –

  1. users need to configure this global shared thread pool size using Reactor specific env var to accommodate for all processor instances need,
  2. users need to also scan through application and third-party components (e.g. Spring) to see if those also uses this shared global pool. If they do, such uses must be considered as well when sizing the pool.

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(..) in Non session Processor builder -

maxConcurrentCalls(int:concurrency, bool:useDedicatedThreadPool)

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.

@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

com.azure:azure-messaging-servicebus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants