1 Reply Latest reply on Aug 20, 2013 5:46 PM by jbertram

    Specify maxSession in JCA RA config

    ckesler

      I'm using JBoss 4.0.3 with HornetQ 2.2.5 as the J2EE JMS provider. We are not yet on EJB3 (old stuff, I know).  I'm trying to set the maxSession variable as documented in 32.3 and 32.4 of the HornetQ user guide.  There is a reference to the ability to set this value in JCA connector (ra.xml).  But for the life of me I cannot figure out how!  The documentation implies that this is a configuration property of the inbound configuration so I tried putting a config property like this in the <inbound-resourceadapter>:

       

      <config-property>

        <description>The number of JMS sessions to allocate for message consumers</description>

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

        <config-property-type>java.lang.Integer</config-property-type>

        <config-property-value>1</config-property-value>

      </config-property>

       

      But this is illegal XML as defined by http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd and will therefore not parse correctly on startup of JBOSS.

       

      I tried putting this in the general properties within the <resourceadaptor> tag, but that does not work either.

       

      I do NOT want to have to specify this in an annotation on the MDB class!  Our product is installed at multiple customer sites and each customer may need to configure this setting based upon their volume of messages.

       

       

        • 1. Re: Specify maxSession in JCA RA config
          jbertram

          Look at the Java EE examples shipped with HornetQ 2.2.5.  I know there are a few that have modified the ra.xml.  Aside from that, your capitalization looks wrong.  Try this:

           

          <config-property>

            <description>The number of JMS sessions to allocate for message consumers</description>

            <config-property-name>MaxSession</config-property-name>

            <config-property-type>java.lang.Integer</config-property-type>

            <config-property-value>1</config-property-value>

          </config-property>

           

          Lastly, I don't think you would be able to set this on the MDB class even if you wanted to.  If you are, as you say, not using EJB3 then activation configuration properties like this would have be set in ejb-jar.xml (or perhaps jboss.xml).  Furthermore, you could use system property substitution to externalize any of these values so they could be easily changed for different environments.