Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏

第 60 章 Spring Cloud

目录

60.1. Spring Cloud 相关的 application.properties 配置
60.1.1. 启用或禁用 bootstrap
60.1.2. bootstrap.properties 配置文件

60.1. Spring Cloud 相关的 application.properties 配置

60.1.1. 启用或禁用 bootstrap

			
spring.cloud.bootstrap.enabled=false
spring.cloud.bootstrap.location=classpath:bootstrap.properties
			
			

60.1.2. bootstrap.properties 配置文件

bootstrap.properties 是优先级最高配置文件,一般用于 Spring Cloud 配置中心。

bootstrap.yml是由spring.cloud.bootstrap.name(默认:”bootstrap”)或者spring.cloud.bootstrap.location 设置(默认空)。

如果激活 profile(spring.profiles.active=development)对应配置 bootstrap-development.properties

spring.cloud.config.allowOverride=true(允许本地配置覆盖远程配置)。

spring.cloud.config.overrideNone=true 覆盖任何本地属性

spring.cloud.config.overrideSystemProperties=false 仅仅系统属性和环境变量