博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
disconf
阅读量:7006 次
发布时间:2019-06-27

本文共 1201 字,大约阅读时间需要 4 分钟。

disconf.xml

1、xml配置

classpath:version.properties

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 检测到更新");    }}

 

转载于:https://www.cnblogs.com/gendway/p/10696074.html

你可能感兴趣的文章