Reputation: 256
I have some EJB with @Asynchronous
method.
I try to figure out what happens when all threads configured in pool are in processing and one more asynchronous call comes?
I found some answer in this post, but it is only for Websphere:
I would like to know what happens on JBoss and if there is some option to queue threads like on Websphere.
I configure thread-pool like this:
<subsystem xmlns="urn:jboss:domain:ejb3:1.2">
<async thread-pool-name="default"/>
<thread-pools>
<thread-pool name="default">
<max-threads count="10"/>
<keepalive-time time="100" unit="milliseconds"/>
</thread-pool>
</thread-pools>
...
</subsystem>
I tried to use bounded-queue-thread-pool
insinde of <thread-pools>
element, but it does not work.
thank you for help
Upvotes: 0
Views: 4312
Reputation: 66
Below is a description of the pool.
"A thread pool executor with an unbounded queue. Such a thread pool has a core size and a queue with no upper bound. When a task is submitted, if the number of running threads is less than the core size, a new thread is created. Otherwise, the task is placed in queue. If too many tasks are allowed to be submitted to this type of executor, an out of memory condition may occur. The "name" attribute is the name of the created executor. The "max-threads" attribute must be used to specify the thread pool size. The nested "keepalive-time" element may used to specify the amount of time that pool threads should be kept running when idle; if not specified, threads will run until the executor is shut down. The "thread-factory" element specifies the bean name of a specific threads subsystem thread factory to use to create worker threads. Usually it will not be set for an EJB3 thread pool and an appropriate default thread factory will be used."
Source: http://www.jboss.org/schema/jbossas/jboss-as-ejb3_1_2.xsd
Upvotes: 5