9 Replies Latest reply on Mar 16, 2012 11:02 AM by t3rm1

    MDB maxSession limit of 20?

    Guenther Bodlak Newbie



      I have the following MDB with a maxSession=30 property.




      @MessageDriven(name = "MessageMDBSample",

                     activationConfig = {@ActivationConfigProperty(propertyName = "destinationType",

                                                                   propertyValue = "javax.jms.Queue"),

                                         @ActivationConfigProperty(propertyName = "destination",

                                                                   propertyValue = "queue/sampleQueue"),

                                         @ActivationConfigProperty(propertyName = "maxSession",

                                                                   propertyValue = "30"),

                                         @ActivationConfigProperty(propertyName = "acknowledgeMode",

                                                                   propertyValue = "Auto-acknowledge") })

      public class MDBSample implements MessageListener {



          public void onMessage(Message message) {


              TextMessage tm = (TextMessage)message;

              try {

                  System.out.println("Received message " + tm.getText());


              } catch (Exception e) {








      When I put more than 20 messages into the queue only 20 HornetQ threads start working.

      After 3000 millis the next messages get dequeued.

      How can I increase that limit of 20?


      I tried the thread-pool-max-size element in the messaging subsystem, but without success.



      <subsystem xmlns="urn:jboss:domain:messaging:1.0">











      Thanks a lot


        • 1. Re: MDB maxSession limit of 20?
          Stephen Coy Master

          Have a look for:

                  <subsystem xmlns="urn:jboss:domain:ejb3:1.2">
                              <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
          • 2. Re: MDB maxSession limit of 20?
            Guenther Bodlak Newbie

            Hi Stephen,


            thanks a lot!



            • 3. Re: MDB maxSession limit of 20?
              t3rm1 Newbie



              this setting adjusts how many worker threads exists for a queue. Is it possible to change this value while the server is running? I need to do this because the server has different load at different times of a day. If I have a high load I need this value to be 1 and higher if the load is less.

              • 4. Re: MDB maxSession limit of 20?
                Stephen Coy Master

                This doesn't seem to be possible right now. I thought you may have had some chance with the Command Line Interface, but the ability to modify the parameters above does not seem to be there yet.


                And there was no guarantee that a container restart would not have been needed anyway.


                Perhaps you need more (or bigger) servers?

                • 5. Re: MDB maxSession limit of 20?
                  t3rm1 Newbie

                  The server is big enough for the current work. However we have to do some long one-time work that produces more load which might be too much for the server. I am currently trying to find out if it is somehow possible to control the load a MDB produces. Any hints appreciated

                  • 6. Re: MDB maxSession limit of 20?
                    Stephen Coy Master

                    We'd need to know more about what kind of processing is happening in order to answer this.


                    If it's long running, you may find transaction timeouts to be an issue.


                    If you're concerned about impacting users it may be worthwhile hosting the MDBs on another server instance.

                    • 7. Re: MDB maxSession limit of 20?
                      t3rm1 Newbie

                      The time needed to process one message is really short. However the amount of messages is the problem. There will be around 61 million billion messages in the queue. During the work of a message I need to request another server over http. That's the bottle neck. If only 1 worker thread exists I could ensure that only one request at a time (message) is made. More threads would result in a higher "request per second" rate. I need to control this.

                      • 8. Re: MDB maxSession limit of 20?
                        Justin Bertram Master

                        To my knowledge, there is no way to re-activate an MDB.  However, you should be able to undeploy the MDB, modify it, and redeploy it without stopping the server.


                        Is that 61 billion figure right?  If you only had one session processing messages and you processed one message every millisecond it would take you 700 days to process 61 billion messages.

                        • 9. Re: MDB maxSession limit of 20?
                          t3rm1 Newbie

                          I have no experiance how to do this. I'll take a look. Thanks for your response.

                          Billion was wrong. 61 million is the correct value. 700 days are way too long


                          EDIT: I just discovered the setting <consumer-max-rate>. I might be able to use this if it is possible to change the value during runtime.