This discussion is archived
2 Replies Latest reply: Jan 23, 2013 3:01 AM by nigeldeakin RSS

Applying the same ActivationConfigProperties to multiple MDBs

r035198x Pro
Currently Being Moderated
Is there a portable way of applying the same ActivationConfigProperties to multiple MDBs?

I think it's typical for many applications to contain MDBs which differ only in the destination name so it should promote ease of use and convention over config to have such a feature, say for JMS 2?

Motivation for asking is:
In Jboss 5.1.0 one could use a container defined AspectDomain to define a set of properties that an MDB inherits and overrides at will. This allowed externalization of config properties as well as reuse. This is no longer available in Jboss 7.1.X. and I found myself having to create an ejb-jar.xml file
that contains
....
<ejb-name>MDBName</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>providerSpecificProperty.eg.queueManagerHostName</activation-config-property-name>
          <activation-config-property-value>${departmentA.queueManager.hostName}</activation-config-property-value>
        </activation-config-property>
      </activation-config>
...
where ${departmentA.queueManager.hostName} is an ant style variable configured in Jboss 7 standalone.xml. There's quite a lot of those provider specific properties that I had to define. Then I had to copy and paste the same configs for all the MDBs I had keeping only the queue name definitions on the MDB.
I'm not really looking for the externalization in this request since that's container specific but putting the properties in one place to apply them to multiple MDBs could be helpful in the spec.
One very crude approach would be to allow wildcards on the <ejb-name> values as is allowed for intercepted classes in interceptor definitions (which would make it a request for the EJB spec rather than JMS?)

Anyone know something I can use now with the current specs that allows definition of config properties at one place and reusing the configs over multiple MDBs?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points