Skip to content

属性配置优先级问题 #338

@wangdefeng

Description

@wangdefeng

Spring Boot 工程,属性配置默认在Nacos Config中,本地环境启动Spring Boot 服务时需要覆盖Nacos Config中对应的属性配置(主要是nebula.hosts)。在IDEA 运行参数设置 nebula.hosts 为VPN地址时,发现 NgbatisContextInitializer的initialize 方法被调用了两次,第一次是本地属性被调用,第二次为Nacos Config 中设置的Nebula相关属性被调用,导致服务无法正常启动,Nacos Config 中设置信息只能在公司内网中使用。公司之外需要请求VPN地址才可以。
按照Spring Boot 属性配置优先级原则,初始化客户端应该只初始化一次,且为配置优先级最高的属性为准。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions