Details
-
Feature Request
-
Resolution: Not a Bug
-
Major
-
None
-
24.0.0.Beta1
-
None
-
Undefined
Description
Currently, all asynchronous EJBs use a single thread pool (configured through the async configuration in the ejb3 subsystem).
I'm facing a problem in a project regarding nested asynchronous EJBs: if the first asynchronous call uses all async threads available, all threads end up stopping on the next async call, waiting for a thread which will never exist, resulting in a timeout. I've managed to "fix" this by using @Asynchronous only at the first async point and using ManagedExecutorService at the second. It works, but there's a lot more boilerplate code, since there's a need to "bridge" two EJBs with a Callable, using CDI to manually lookup the second EJB.
If there was a way to configure multiple async thread pools for different EJBs, a lot of good optimizations would be possible.