通过JBoss CLI更改部署时的激活配置属性 [英] Change Activation-Config-Property on deployment via JBoss CLI

查看:237
本文介绍了通过JBoss CLI更改部署时的激活配置属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们想使用JBoss CLI部署一个包含消息驱动bean的EAR.对于每种环境,都有不同的激活配置属性值.

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

我们的问题:在使用JBoss CLI部署EAR之后,是否可以更改激活配置属性的值?

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).

2011年,这里有一个类似的问题.答案今天可能已经过时了.它提出了在构建时的解决方案.这就是我们现在所拥有的以及有待改进的地方.

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.

背景:MDBS由IBM Websphere MQ资源适配器激活.描述符ejb-jar.xml包含如下片段:

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>

推荐答案

方面域对您没有帮助. JBoss的早期版本中提供了该功能.文章180233的第二个链接从本质上说,当前的JBoss版本不再支持AOP.

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激活规范是在部署时为MDB jar设置的.您可以按照说明使用属性替换来配置MDB.您可以随时更改系统属性:

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

如果您随后重新部署MDB jar,则将替换新的属性值.

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

这篇关于通过JBoss CLI更改部署时的激活配置属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆