mkuff
mkuff

Reputation: 1682

ejb 3.1 JBoss AS 7 Threadpool @Asynchronous

In Java EE 6 I have no control of a threadpool and I cannot create my own (using java.concurrent) without breaking the spec.

So my question is if I launch 10000 Threads over a @Asynchronous annotated method does the server queue this in any manner or does it try to spawn all at once (which would end quite bad)?

Or is there any jboss specific functionality I better should use?

I also took a look at timer based (quarz, @Schedule) solutions which are not exactly that what I need.

Upvotes: 2

Views: 2160

Answers (1)

Carlo Pellegrini
Carlo Pellegrini

Reputation: 5686

Crerdits to the JBoss Community forum wich I'll cite in full:

The thread pool size for EJB3 async invocations is controlled via a ExecutorService defined in JBOSS_HOME/server/<servername>/deployers/jboss-ejb3-async-deployer.jar/META-INF/ejb3-async-deployer-jboss-beans.xml file:

  <bean name="org.jboss.ejb3.async.ExecutorService" class="org.jboss.threads.JBossScheduledThreadPoolExecutor">
    <constructor>
      <parameter>10</parameter>
    </constructor>
  </bean> 

As you can see the default value is 10, but you can change it.

PS: Google is your friend :). 1st result searching jboss @asynchronous size

Upvotes: 2

Related Questions