4 Replies Latest reply on Aug 21, 2011 6:21 PM by rhinmass

    Configuring the number of listeners on a per-queue basis

    rhinmass

      I am using JBoss 6.0.0.Final with HornetQ 2.1.2 , and attempting to upgrade to HQ 2.2.5.

       

      My application uses several queues, and I would like to have a different concurrency value for the MDBs servicing each type of queue.  The reason is that I need to throttle the activity of these queue listeners as they use significant system resources and band width.  I would like to be able to designate some queues as having a single listeners and give other queues 2 or 3 or more. 

       

      I'm looking for a way to configure this per-queue at run-time.  Note that some of the queues are different instantiations of the same MDB class (defined  in ejb-jar.xml), so a class-based value would not be sufficient.   Further it needs to be configurable without rebuilding the application, so an annotation will not work.

       

      I have tried setting maxSessions in the activationConfig in ejb-xml.jar.  This gives me the behavior I need, but maxPoolSize is still set to the default value of 15.  Does anyone know of a way to set MaxPoolSize on a per-queue basis using XML or JMX?

       

      Thanks for any help!

        • 1. Re: Configuring the number of listeners on a per-queue basis
          tagnegilles

          Hi Robin,

           

          you can change the maxPoolSize of your listener by using the annotation @org.jboss.ejb3.annotation.Pool(maxSize=1) for example. If you want to do it with xml you have to create the jboss.xml-file. In the jboss-6.0.0.Final/docs/dtd/jboss_6_0.dtd-file you can see how to make this configuration. you could have a look to this documentation

           

           

          Gilles

          • 2. Re: Configuring the number of listeners on a per-queue basis
            rhinmass

            I can see how jboss.xml could be used to change the default for the container.  I don't see how it could be used to change the maxPoolSize for listeners bound to a particular named queue.

            • 3. Re: Configuring the number of listeners on a per-queue basis
              tagnegilles

              Hi Robin,

               

              please you have to read this documentation. It's explain you to change the maxPoolSize for the listener( Message-Driven-Bean) bound to a particular named queue.

              1 of 1 people found this helpful
              • 4. Re: Configuring the number of listeners on a per-queue basis
                rhinmass

                Thank you for pointing that out, Gilles.  I had not noticed before that jboss.xml allowed the ejb-name and destination-jndi-name.  However, I am getting this error when I tried that method:

                 

                DEPLOYMENTS IN ERROR:

                  Deployment "vfs:///C:/jboss/jboss-6.0.0.Final/server/email-server/deploy/email-ear-1.0-SNAPSHOT.ear" is in error due to the following reason(s): java.lang.RuntimeException: Could not get container for bean class com.mydomain.email.ConfigurableMessageBean with bean name ConfigurableMessageBean4 because

                no container configured with name 'Strictly Pooled Message Driven Bean'

                 

                        at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.GA]

                        at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.GA]

                        at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.Final]

                        at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]

                        at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.0.0.Final]

                        at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]

                        at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

                        at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

                 

                I saw a similar error posted in another thread  http://community.jboss.org/message/367101 , but no answer given.

                 

                Here is the contents of my ejb META-INF (which is inside an EAR)

                 

                meta inf ss.bmp

                Have you (or anyone)  been able to get this to work, and was there another step necessary other than the steps given in http://docs.jboss.org/ejb3/docs/reference/1.0.7/html/SessionBean_and_MDB_configuration.html

                 

                Thank you again for taking the time to point me in the right direction.

                 

                Robin