MDB动态设置ActivationConfig [英] MDB set ActivationConfig dynamically
问题描述
我有以下MDB配置
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
@ActivationConfigProperty(propertyName = "destinationJndiName", propertyValue = "jms/test/log"),
@ActivationConfigProperty(propertyName= "destination", propertyValue="jms_test_log"),
@ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue="Auto-acknowledge"),
@ActivationConfigProperty(propertyName="addressList", propertyValue="mq://test.server.co.uk:7676"),
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "10")
})
@TransactionManagement(TransactionManagementType.BEAN)
public class DownloadListener implements MessageListener { ....
我希望能够动态设置addressList属性。值将来自初始设置属性文件和未来的管理控制台。由于它不属于类decleration,我无法简单地分配变量。
I wish to be able to set addressList property dynamically. The values will be from an initial setup properties files and from a future admin console. As it is out of the class decleration I am unable to simply assign a variable.
我已经看到你可以将这些值添加到各种类型的xml文件中但似乎依赖于供应商,例如JBoss的。我不想把它绑在一个供应商身上。我需要它以这种方式打开。
I have seen that you can add these values into an xml file of sorts but it seems to be vendor dependant e.g. JBoss. I don't want to strap this down to one vendor. I need it to open in that way.
我环顾四周,我找不到任何暗示我可以做这样的事情。是否可以像设置方法那样设置配置?
I have looked around and I am unable to find anything that suggests I could do such a thing. Is it possible to set up the configuration in something like a setup method?
推荐答案
不,没有标准的动态设置方式激活配置属性。我甚至从未听说过特定于供应商的动态设置激活配置属性的方法。我想您可以动态重建EAR并使用特定于供应商的API重新部署它,或者某些应用程序服务器支持动态覆盖该配置。
No, there is no standard way to dynamically set activation config properties. I've never even heard of a vendor-specific way to dynamically set activation configuration properties. I suppose you could dynamically rebuild the EAR and redeploy it using vendor-specific APIs, or perhaps some application server supports dynamically overriding that configuration.
这篇关于MDB动态设置ActivationConfig的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!