MDB set ActivationConfig dynamically

风流意气都作罢 提交于 2019-12-01 10:39:16

问题


I have the following MDB configuration

@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 { ....

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.

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?


回答1:


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.



来源:https://stackoverflow.com/questions/34921341/mdb-set-activationconfig-dynamically

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!