0

We would like to deploy an EAR containing message driven beans with JBoss CLI. For each environment there are different activation config property values.

Our question: is it possible to change the values of the activation config properties after deploying the EAR with JBoss CLI?

We know we could use property substitution. However this seems to set the activation properties at server startup. In contrast we would like to change the values at any time (maybe as long as application is disabled).

In 2011 there where a similar question. The answer might be outdated today. It suggests a solution at build time. This is what we have now and what is to be improved.

Background: The MDBS are activated by an IBM Websphere MQ resource adapter. The descriptor ejb-jar.xml contains snippets like the following one:

<message-driven>
  <ejb-name>MyMDB</ejb-name>
  <ejb-class>com.acme.MyMDB</ejb-class>
  <messaging-type>javax.jms.MessageListener</messaging-type>
  <activation-config>
    <activation-config-property>
      <activation-config-property-name>hostName</activation-config-property-name>
      <activation-config-property-value>hostName</activation-config-property-value>
    </activation-config-property>
    <activation-config-property>
      <activation-config-property-name>port</activation-config-property-name>
      <activation-config-property-value>1415</activation-config-property-value>
    </activation-config-property>
    <activation-config-property>
      <activation-config-property-name>queueManager</activation-config-property-name>
      <activation-config-property-value>queueManagerName</activation-config-property-value>
    </activation-config-property>
    <activation-config-property>
      <activation-config-property-name>channel</activation-config-property-name>
      <activation-config-property-value>channelName</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>useJNDI</activation-config-property-name>
      <activation-config-property-value>true</activation-config-property-value>
    </activation-config-property>
    <activation-config-property>
      <activation-config-property-name>destination</activation-config-property-name>
      <activation-config-property-value>java:jboss/queueName</activation-config-property-value>
    </activation-config-property>
  </activation-config>
</message-driven>
Community
  • 1
  • 1
Claude
  • 1,724
  • 3
  • 17
  • 46

2 Answers2

2

One possible solution could be to "try to convert your MDBs into AspectDomain", an idea of which you could get from the link below:

https://developer.jboss.org/thread/178162

More details should be available here:

How to set MDB ActivationConfigProperty at runtime using JBoss AOP in JBoss EAP 6

https://access.redhat.com/solutions/180233

Alex Mi
  • 1,409
  • 2
  • 21
  • 35
  • I'm afraid I have no access to the second resource. However, I will ask a friend of mine to check this. Thanks for the hint. The first resource has a comment "That's a deployment time configuration which can't be changed at runtime". Do I need AOP as a prerequisite for the second link? – Claude Feb 15 '17 at 05:55
  • @Claude, unfortunately I also do not have an access to the link, but I would encourage you to google. This link might also be helpful to you: http://stackoverflow.com/a/34926075/1925356 – Alex Mi Feb 15 '17 at 14:34
2

The aspect domain will not be helpful for you. This was available in earlier versions of JBoss. The second link to article 180233 essentially says that AOP is not longer supported in the current JBoss releases.

MDB activation specs are set at deployment time for the MDB jar. You can use property substitution as noted to configure your MDB. You can change the system properties on the fly:

/system-property=wmq.port:remove
/system-property=wmq.port:add(value=1515)
/system-property=wmq.port:read-resource

If you then re-deploy your MDB jar, the new property value would be substituted.

Doug Grove
  • 962
  • 5
  • 5