If you are using Spring boot have a look on @ConfigurationProperties
. You will be required to provide a Bean to access your properties.
Therefore original values of the properties can be changed during execution since they are regular properties of a bean.
In your case for example:
@Component
@ConfigurationProperties
public class JmsProperties {
private String url = "vm://localhost" (let's suppose you use ActiveMQ);
public String getUrl()...
public void setUrl(String value)...
}
And then inject this bean in you JMS message listener.
Of course if you use JMS and Spring boot, with autoconfiguration you already have Properties class...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…