4 Replies Latest reply on Mar 7, 2012 12:50 PM by rathm1

    Externalize MDB Properties Jboss 7.1

    rathm1 Newbie

      I have the MQ Resource Adapter working successfully but now have the issue that the inbound MDB it is not configurable outside of our EAR.

      In Jboss6.1.0 we had defined system properties in the jboss-service.xml and referred to these in the jboss.xml as ${some_property} (jboss.xml was where we had our incoming mdb configured previously).

       

      In Jboss 7.1, I have configured the system properties inside the standalone.xml but using the same ${some_property} reference doesn't seem to work, it takes the value literally as ${some_property} thus breaking the MDB configuration.

       

      Our Incoming MDB is now configured as the following with hard coded values in the ejb-jar.xml.

      <message-driven>

                  <ejb-name>ReplyMDB</ejb-name>

                  <activation-config>

                      <activation-config-property>

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

                          <activation-config-property-value>javax.jms.Queue</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>REPLY_QUEUE</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>CHANNEL</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>HOST</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>1111</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>QUEUE_MNGR</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>false</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>CLIENT</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>username</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>password</activation-config-property-value>

                      </activation-config-property>

                  </activation-config>

              </message-driven>

       

      But we would like it to be more like:

      <message-driven>

                  <ejb-name>ReplyMDB</ejb-name>

                  <activation-config>

                      <activation-config-property>

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

                          <activation-config-property-value>javax.jms.Queue</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>${reply_queue_name}</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>${channel_name}</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>${host_name}</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>${port_number}</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>${queue_manager}</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>false</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>CLIENT</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>${queue_username}</activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

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

                          <activation-config-property-value>${queue_password}</activation-config-property-value>

                      </activation-config-property>

                  </activation-config>

              </message-driven>

       

      With the following in the standalone.xml:

      <system-properties>

              <property name="reply_queue_name" value="REPLY_QUEUE"/>

              <property name="channel_name" value="CHANNEL"/>

              <property name="host_name" value="HOST"/>

              <property name="port_number" value="1111"/>

              <property name="queue_manager" value="QUEUE_MNGR"/>

              <property name="queue_username" value="username"/>

              <property name="queue_password" value="password"/>

          </system-properties>

       

      Any suggestions for how to accomplish would be great.

      Thanks.