package com.yihu.hos.common.activeMq; import org.springframework.beans.factory.annotation.Value; import javax.annotation.PostConstruct; /** * 配置文件参数-静态初始化 * @author HZY * @vsrsion 1.0 * Created at 2016/8/21. */ //@Configuration public class ActivemqConfiguration { @Value("${spring.activemq.broker-url}") private String brokerURL; @Value("${spring.activemq.user}") private String user; @Value("${spring.activemq.password}") private String password; @PostConstruct public void init() { ActiveMqConstants.ACTIVE_MQ_USER = user; ActiveMqConstants.ACTIVE_MQ_PASS = password; ActiveMqConstants.ACTIVE_MQ_URI = brokerURL; } }