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

MaxConcurrency annotation #136

Open
smillidge opened this issue Mar 17, 2021 · 4 comments
Open

MaxConcurrency annotation #136

smillidge opened this issue Mar 17, 2021 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@smillidge
Copy link
Contributor

Annotation to define max concurrency for access to a method or bean. This was first mooted on the EJB spec but adding to concurrency would mean this could be used generally across the platform.

See javaee/ejb-spec#9

Also see https://download.eclipse.org/microprofile/microprofile-fault-tolerance-2.1/apidocs/org/eclipse/microprofile/faulttolerance/Bulkhead.html

@smillidge smillidge added this to the 3.0 milestone Mar 17, 2021
@smillidge
Copy link
Contributor Author

If we have the new Async annotation I think we can have a very simple definition with just a single attribute for maxConcurrency and rely on Semaphore isolation. As the new Async annotation allows the developer to specify the specific ExecutorService which can be configured to have a maxAsync. Thread isolation can be acheived using the Async annotation and a ExecutorService with a configured maxAsync

@njr-11 njr-11 modified the milestones: 3.0, 3.1 Jan 13, 2022
@smillidge smillidge added the enhancement New feature or request label Dec 19, 2022
@edburns
Copy link

edburns commented Sep 26, 2023

Any word on getting this in for EE 11?

@smillidge
Copy link
Contributor Author

it's tagged as a candidate for 3.1 which is the Jakarta EE 11 release. I don't think any work has been done yet though.

@KyleAure KyleAure modified the milestones: 3.1.0, 3.2.0 Jul 1, 2024
@njr-11
Copy link
Contributor

njr-11 commented Jan 15, 2025

It seems like the most important part of this is already covered by Asynchronous/executor with maxAsync, and all that remains is semaphore isolation. I am wondering what the value is of providing a @MaxConcurrency to enforce sempahore isolation when a user can already do that with java.util.concurrent.Sempahore and other classes of java.util.concurrent. How much benefit does the user get from having the Jakarta EE product provider hold onto the semaphore for them and automatically invoke it upon entry and exit from methods of a class? Is there more to this that I am not aware of?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants