nacos配置中心

application.properties文件

spring.profiles.active=prod

 

 

application-prod.properties文件

nacos.config.server-addr=192.168.99.10:8848
nacos.config.namespace=5016085c-9861-447f-bb57-21d5562752fa
#nacos.config.ext-config[0].data-id=nacos.log
nacos.config.ext-config[0].group=HRMIS
nacos.config.ext-config[0].max-retry=10
nacos.config.ext-config[0].type=text,xml,yaml,properties
nacos.config.ext-config[0].auto-refresh=true
nacos.config.ext-config[0].config-retry-time=2333
nacos.config.ext-config[0].config-long-poll-timeout=46000
nacos.config.ext-config[0].enable-remote-sync-config=true

 

 

 

@NacosPropertySource(dataId = "application.properties", groupId = "HRMIS", autoRefreshed = true, first = true, before = SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, after = SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)
@NacosPropertySource(dataId = "app.uconfig-policy.xml", groupId = "HRMIS", autoRefreshed = true, first = true, before = SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, after = SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)
@NacosPropertySource(dataId = "app.web.properties", groupId = "HRMIS", autoRefreshed = true, first = true, before = SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, after = SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)
@NacosPropertySource(dataId = "caffeine.properties", groupId = "HRMIS", autoRefreshed = true, first = true, before = SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, after = SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)
@NacosPropertySource(dataId = "logback-spring.xml", groupId = "HRMIS", autoRefreshed = true, first = true, before = SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, after = SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)
@EnableEncryptableProperties
public class HrmisApplication {
    public static void main(String[] args) {
        SpringApplication.run(HrmisApplication.class, args);
    }

}

 

 

 

先建命名空间,然后建配置列表

建配置列表时记得先选择命名空间

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值