2 Replies Latest reply on Jun 7, 2011 11:45 PM by kennardconsulting

    Control MDB maxSession dynamically/programmatically?

    kennardconsulting

      Hi guys,

       

      I have recently upgraded from JBoss Messaging to HornetQ and I'm very impressed. I'm now interested in trying to squeeze extra performance out of our server cluster!

       

      Is it possible to dynamically/programmatically adjust the MDB 'maxSession' value we are currently setting in ejb-jar.xml's <message-driven> section? I would like to be able to configure it based on, say, number of CPU cores or available memory or time of day.

       

      Regards,

       

      Richard.

        • 1. Re: Control MDB maxSession dynamically/programmatically?
          clebert.suconic

          That's an EJB question. But I don't think so.

          1 of 1 people found this helpful
          • 2. Re: Control MDB maxSession dynamically/programmatically?
            kennardconsulting

            Clebert,

             

            Okay cool. It appears I can get 'close enough' by using some JBoss EL in ejb-jar.xml:

             

             

             

             

             

             

             

             

             

             

             

             

            <message-driven>

             

            <ejb-name>LongRunningProcessConsumerBean</ejb-name>

             

            <messaging-type>javax.jms.MessageListener</messaging-type>

             

            <message-destination-type>javax.jms.Queue</message-destination-type>

             

            <activation-config>

             

            <activation-config-property>

             

            <activation-config-property-name>maxSession</activation-config-property-name>

             

            <activation-config-property-value>${some.command.line.variable:2}</activation-config-property-value>

             

            </activation-config-property>

             

            </activation-config>

             

            </message-driven>

             

             

            And then some Unix scripting to set that variable during run.sh.

             

            Regards,

             

            Richard.