我使用下面的注释:将动态参数传递给注释?
@ActivationConfigProperty(
propertyName = "connectionParameters",
propertyValue = "host=127.0.0.1;port=5445,host=127.0.0.1;port=6600"),
public class TestMDB implements MessageDrivenBean, MessageListener
我想拉这些IP地址和端口,并将它们存储在一个文件中jmsendpoints.properties
......然后动态加载它们。就像这样:
@ActivationConfigProperty(
propertyName = "connectionParameters",
propertyValue = jmsEndpointsProperties.getConnectionParameters()),
public class TestMDB implements MessageDrivenBean, MessageListener
有没有办法做到这一点?
你可以有'propertyValue =“jmsendpoints.properties ConnectionParameter”'你动态解析。 –