1 Reply Latest reply on Feb 19, 2012 2:13 AM by jaikiran

    How to set the maxSession for an MDB at runtime in JBoss 7?

    magnusb

      In JBoss 5.1 I was able to have an ejb-jar.xml that referenced a system property for setting the maxSessions for an MDB. But in JBoss AS 7, if I use a variable the setting is not applied.

      This is a problem as the ejb-jar.xml is compiled into the ear file, and I need to be able to set this value as runtime. Is there a way to set the maxsessions for an MDB in jboss as 7 at run time?

       

      e.g. working config in jboss 5.1:

       

      <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"

                version="3.0">

                <description>Deployment descriptor</description>

                <enterprise-beans>

                          <message-driven>

                                    <ejb-name>WorkerMdb</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>${worker.threads:8}</activation-config-property-value>

                                              </activation-config-property>

                                    </activation-config>

                          </message-driven>

                </enterprise-beans>

      </ejb-jar>