disconf.xml
1、xml配置
2、应用属性配置
/** * 描述: ID 属性 * * @author 01374806 * @date 2018/10/2 */@DisconfFile(filename = "id.properties")@Componentpublic class IdProperties { private Long datacenterId = 0L; @DisconfFileItem(name = "dds.rss.route.id.datacenterId", associateField = "datacenterId") public Long getDatacenterId() { return datacenterId; } public void setDatacenterId(Long datacenterId) { this.datacenterId = datacenterId; }}
3、回调(消息通知配置)
@Slf4j@Component@DisconfUpdateService(confFileKeys = { "dispatch.properties" })public class DispatchPropertiesCallback implements IDisconfUpdate { @Override public void reload() throws Exception { log.info("dispatch.properties 检测到更新"); }}