我使用下面的註釋:將動態參數傳遞給註釋?
@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」'你動態解析。 –