5 Replies Latest reply on Sep 8, 2011 3:49 AM by harishpandya

    Configure MDB PoolSize

    ejb3workshop

      I would like to increase the default number of MDBs per pool. Using the jmx-console I found that the MaxPoolSize is set to 15. I have tried making various changes to ./conf/standardjboss.xml however none have allowed me to increase the number of MDB instances in my pool. I have found this http://www.jboss.org/ejb3/docs/reference/build/reference/en/html/session-bean-config.html, but I am hoping for easier way to increase my global default pool size.

       

      I know about using annotations, but I want to set the global pool size for all MDBs. This is for two reasons:

       

      1.) I want to be able to change my pool size without having to reconfigure / redeploy my application

      2.) Change all MDBs in one central place

       

       

      Thanks in advance.

      Alex

        • 1. Re: Configure MDB PoolSize
          jaikiran

          This is more of a EJB3 question and would be better in the EJB3 user forum. Which version of JBoss AS do you use?

          • 2. Re: Configure MDB PoolSize
            ejb3workshop

            I will raise it on that forum as well. I am using 4.2.3 with JBM 1.4.2-SP1

             

            Thanks

            Alex

            • 3. Re: Configure MDB PoolSize
              jaikiran

              ejb3workshop wrote:

               

              I will raise it on that forum as well.


              Don't worry, some moderator will move this thread there.

               

              I am using 4.2.3 with JBM 1.4.2-SP1

               

              Thanks

              Alex

              You can change the value in JBOSS_HOME/server/< servername>/deploy/ejb3-interceptors-aop.xml:

               

              <domain name="Message Driven Bean">
                    <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
                       <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
                    </bind>
                    <bind pointcut="execution(public * *->*(..))">
                       <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
                       <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
                       <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
                       <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
                       <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
                    </bind>
                    <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>
              

               

               

              Change the maxSize value (default=15) to a value of your choice

              • 4. Re: Configure MDB PoolSize
                ejb3workshop
                Thanks, just what I was looking for.
                • 5. Re: Configure MDB PoolSize
                  harishpandya

                  Hi jaikiran,

                   

                                  i want to use concurrency using JMS so i used topic implementation of JMS.

                  My standardjboss.xml is

                   

                   

                  <proxy-factory-config>
                          <JMSProviderAdapterJNDI>DefaultJMSProvider</JMSProviderAdapterJNDI>
                          <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
                          <CreateJBossMQDestination>true</CreateJBossMQDestination>
                          <!-- WARN: Don't set this to zero until a bug in the pooled executor is fixed -->
                          <MinimumSize>2</MinimumSize>
                          <MaximumSize>2</MaximumSize><!--how many parellel need for FPM -->
                          <KeepAliveMillis>150000</KeepAliveMillis>
                          <MaxMessages>15</MaxMessages>
                          <MDBConfig>
                            <ReconnectIntervalSec>10</ReconnectIntervalSec>
                            <DLQConfig>
                              <DestinationQueue>queue/DLQ</DestinationQueue>
                              <MaxTimesRedelivered>10</MaxTimesRedelivered>
                              <TimeToLive>0</TimeToLive>
                            </DLQConfig>
                          </MDBConfig>
                        </proxy-factory-config>

                   

                   

                  Concurrency is achieved. But the problem is that concurrency is applied to a fixed no of messages after that remaining messages are taken sequentially.

                  Ex.

                   

                  No. of messages on topic(range)                             Connecurrency performed for message                         Sequential

                                   11-15                                                                       4 (2 parellel)                                                 7-11

                                  21-24                                                                       10(5 parellel)                                                11-15

                                  25-29                                                                       18(9 parellel)                                                7-11

                                  35-40                                                                       34(17 perellel- best perf.)                              1-6

                   

                   

                  do you know why such pattern is followed & can we restrict it.

                   

                   

                  Thanks in Advance.