2 Replies Latest reply on Aug 14, 2009 6:25 AM by Siddharth Bondre

    Help configure MDB threads

    Gerald Turner Newbie

      Under JBoss 4.0 and earlier versions I had an MDB with the following jboss.xml deployment descriptor:

      <jboss>
       <enterprise-beans>
       <message-driven>
       <ejb-name>LoggingMDB</ejb-name>
       <destination-jndi-name>queue/loggingQueue</destination-jndi-name>
       <configuration-name>LoggingMDB Message Driven Bean</configuration-name>
       </message-driven>
       </enterprise-beans>
       <container-configurations>
       <container-configuration extends="Standard Message Driven Bean">
       <container-name>LoggingMDB Message Driven Bean</container-name>
       <container-pool-conf>
       <MinimumSize>1</MinimumSize>
       <MaximumSize>100</MaximumSize>
       <strictMaximumSize>false</strictMaximumSize>
       </container-pool-conf>
       <depends>xo.services:service=ConfigurationManager</depends>
       </container-configuration>
       </container-configurations>
      </jboss>
      


      It worked, the MDB would scale up to 100 threads.

      However now we've upgraded our servers to JBoss 4.2.3, and the MDB seems to be limited to 15 threads.

      As a first step in fixing this, I updated the MDB code/packaging to EJB3 with annotation such as:

      @MessageDriven
       (activationConfig={
       @ActivationConfigProperty(propertyName="destinationType",
       propertyValue="javax.jms.Queue"),
       @ActivationConfigProperty(propertyName="destination",
       propertyValue="queue/loggingQueue"),
       @ActivationConfigProperty(propertyName = "maxSession",
       propertyValue = "100")})
      


      However it still seems to be limited to 15 threads.

      Reviewing random bits of unorganized wiki documentation I found the answer may be in deploy/ejb3-interceptors-aop.xml:

       <domain name="Message Driven Bean">
       ...
       <annotation expr="!class(@org.jboss.annotation.ejb.PoolClass)">
       @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=15, timeout=10000)
       </annotation>
       </domain>
      


      Could somebody please explain to me whether it's possible to:

      * Configure these annotations in a separate file, preferably bundled in the EJB jar/ear?

      * Affect the pool size of this particular MDB, rather than the default which would affect other MDBs?