1 2 Previous Next 18 Replies Latest reply on Jul 17, 2015 7:58 AM by uh_69

    MDB Pool size configuration

      I'm looking for a definitive answer on configuring the pool size for an MDB.  I've seen several conflicting answers between forum posts and documentation, see http://community.jboss.org/thread/147300?tstart=30

       

      Is it the @Pool annotation?  http://www.jboss.org/file-access/default/members/jbossejb3/freezone/docs/reference/1.0.7/html/SessionBean_and_MDB_configuration.html

       

      @Pool(value=PoolDefaults.POOL_IMPLEMENTATION_STRICTMAX,maxSize=50,timeout=1800000)

       

      Is it the @PoolClass annotation?   http://www.jboss.org/ejb3/docs/reference/build/reference/en/html/session-bean-config.html

       

      @PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=50, timeout=1800000)

       

      Is it the MaxPoolSize ActivationConfigProperty?

       

       

      @MessageDriven(
          activationConfig={

              ...
              @ActivationConfigProperty(propertyName="MaxPoolSize",propertyValue="50")
          }
      )


      I've also seen a suggestion to change this section in ejb3-interceptors-aop.xml

       

       

           <annotation expr="!class(@org.jboss.ejb3.annotation.Pool)">
               @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=15, timeout=10000)
            </annotation>

       

       

      But that applies to every MDB.

       

      I've also looked at the message-driven-bean invoker-proxy-binding in standardjboss.xml and changing the MaximumSize, but that also applies to every MDB.

       

      I've tried the @Pool annotation.  I see that MaxPoolSize is 50 in the jmx-console, but if I do a thread dump when there are many thousands of messages backed up in the queue, I only see 15 WorkManager threads processing messages.

       

      So what do I need to do to get more than 15 messages processed at once?

       

      I'm using JBoss 5.0.1.GA and JBoss Messaging 1.4

        • 1. Re: MDB Pool size configuration

          Hi,

           

          I am running into the same issue. In my case, the 15 'threads' is a bottleneck that can easily be remedied if I could double or triple the pool sizes. I am able to reduce the size to 10 (or any number below 15) but I cannot increase it.

           

          Am I missing something obvious?

           

          This is the closest to an exaplantion I can find: http://community.jboss.org/wiki/ConfigJBossMDB?decorator=print, See 'General Pooling Notes'.

           

          Cheers,

           

           

          -H

          • 2. Re: MDB Pool size configuration

            @Pool and @ActivationConfigProperty together were the solution for us.  It did not work with either one individually but if you set them both, it works.

             

            Hope that helps you.

            • 3. Re: MDB Pool size configuration

              Thanks for the quick reply, Brad.

               

              Thats great news for us. Which properties did you set in the ActivationConfigProperty section? I already have the @Pool set.

              • 4. Re: MDB Pool size configuration

                @MessageDriven(
                    activationConfig={

                        ...
                          @ActivationConfigProperty(propertyName="MaxPoolSize",propertyValue="50")
                     }
                )

                 

                 

                Change "50" to whatever you want your pool size to be.

                • 5. Re: MDB Pool size configuration

                  Thanks Brad!

                   

                  Adding 'maxSession' did the trick for me.

                   

                  @MessageDriven(
                      activationConfig={
                          ...
                            @ActivationConfigProperty(propertyName="maxSession",propertyValue="50")
                       }
                  )
                  

                   

                  I tried using MaxPoolSize as you suggested but i got the following error:

                   

                  No property found for: MaxPoolSize on JavaBean: org.jboss.resource.adapter.jms.inflow.JmsActivationSpec
                  
                  
                  • 6. Re: MDB Pool size configuration

                    Yes maxSession is right.  MaxPoolSize was a brain fart.

                     

                    Glad you got it working.

                    • 7. Re: MDB Pool size configuration

                      Cheers!

                      • 8. Re: MDB Pool size configuration
                        devireddy

                        Thanks for the post. I had the same problem and using both

                         

                         

                        @PoolClass(value = org.jboss.ejb3.StrictMaxPool.class, maxSize = 30)

                         

                        and

                         

                        @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "30")

                         

                        Helped me.

                         

                        Thank you

                        Raj

                        • 9. Re: MDB Pool size configuration
                          pedrong

                          I have been suffering trying to tune my MDB's pools so I would like to share some things I found out:

                           

                          1.

                          Change ejb3-interceptors-aop.xml its only good if you want/can change the config to all of yours ejbs.

                          If you have, for instance, many MDBs and want to increase the pool for just that critical one, change the ejb3-interceptors-aop.xml may not be a good choice since all others MDB's pools will be increased as well and some memory will be wasted.

                          Besides that, you are going to increase a bit your deployment complexity since a file outside your ear/jar needs to be managed.

                           

                          2.

                          @Pool or @PoolClass?

                          It depends on your JBoss version. For <= 4.2.3 @PoolClass, otherwise, @Pool.

                          I tested only in 4.2.3 and 5.1.0.

                           

                          3.

                          @ActivationConfigProperty(propertyName = "maxSession", propertyValue = XX)

                          I keep the XX equal to the pool size. The maxSession property defines the "the maximum number of jms sessions that can concurrently deliver  messages to this mdb", so it makes sense to me keep then equal. What do you think?

                           

                          4.

                          Using XML (*-aop.xml)

                          With an ejb jar inside an ear, I could only make it work with @AspectDomain annotation.

                           

                          Hope it help!

                          These are just my experience, if someone want to add something, please, do it!

                          • 10. Re: MDB Pool size configuration
                            letincho

                            Hi,

                             

                            I'm using JBoss 5.1. This configuration has worked for me:

                             

                            @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "50")})
                            @Pool (value=PoolDefaults.POOL_IMPLEMENTATION_STRICTMAX,maxSize=50,timeout=20000)

                            @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "50")})

                            @Pool (value=PoolDefaults.POOL_IMPLEMENTATION_STRICTMAX,maxSize=50,timeout=20000)

                             

                            @PoolClass is an attribute for JBoss 4. In JBoss 5 it was replaced by @Pool.

                             

                            Bye,

                            • 11. Re: MDB Pool size configuration
                              konami

                              For JBoss 5.1, modifying following setting in deploy/jca-jbos-beans.xml works.

                               

                              <bean name="WorkManagerThreadPool" class="org.jboss.util.threadpool.BasicThreadPool">

                              ....

                              ....

                              ....

                              <property name="maximumPoolSize">xx</property>

                              • 12. Re: MDB Pool size configuration
                                jaabax

                                I found that:

                                {code}

                                ...

                                @MessageDriven(

                                ...

                                     @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "100") })

                                @Pool(value = PoolDefaults.POOL_IMPLEMENTATION_THREADLOCAL, maxSize = 100, timeout = 10000)

                                ...

                                {code}

                                have the same effect as (with no @ActivationConfigProperty with maxSession property):

                                {code}

                                ...

                                @Pool(value = PoolDefaults.POOL_IMPLEMENTATION_STRICTMAX, maxSize = 100, timeout = 10000)

                                ...

                                {code}

                                can somebody explain us with more details the differences between both approaches?

                                thanks in advance

                                • 13. Re: MDB Pool size configuration
                                  wolfc

                                  maxSession determines the amount of session/consumers the resource adapter will create to forward messages into the MDB.

                                  The pool size governs the amount of MDB instances that are available for processing this inflow.

                                  • 14. Re: MDB Pool size configuration
                                    jaabax

                                    hi Carlo de Wolf

                                    and what the difference of PoolDefaults.POOL_IMPLEMENTATION_THREADLOCAL an PoolDefaults.POOL_IMPLEMENTATION_STRICTMAX

                                    what algorithm should I use and when?

                                    thanks in advance

                                    1 2 Previous Next