springcloud config
规则:
一.获取文件属性
/{label}/{application}-{profile}.properties/yml
http://localhost:8080/master/case-dev.properties
=> profile: dev1.0
二。获取JSON格式配置属性
/{application}/{profile}[/{label}]
/{application}-{profile}[/{label}]
http://localhost:8080/case/dev/master
{
"name": "case",
"profiles": ["dev"],
"label": "master",
"version": "d45f36e5235bbafcb288d553a53299e4f294a4ba",
"propertySources": [{
"name": "https://gitee.com/ecodeshw/springcloud_cfg/case-dev.properties",
"source": {
"profile": "dev1.0"
}
},
{
"name": "https://gitee.com/ecodeshw/springcloud_cfg/case.properties",
"source": {
"profile": "default 1.0"
}
}]
}
http://localhost:8080/case/dev/cfg-v2.0
{
"name": "case",
"profiles": ["dev"],
"label": "cfg-v2.0",
"version": "c7ed90df53723593694234786785a9ba6c28ad83",
"propertySources": [{
"name": "https://gitee.com/ecodeshw/springcloud_cfg/case-dev.properties",
"source": {
"profile": "dev2.0"
}
},
{
"name": "https://gitee.com/ecodeshw/springcloud_cfg/case.properties",
"source": {
"profile": "default 2.0"
}
}]
}
http://localhost:8080/case-dev/master
{
"name": "case-dev",
"profiles": ["master"],
"label": "master",
"version": "d45f36e5235bbafcb288d553a53299e4f294a4ba",
"propertySources": [{
"name": "https://gitee.com/ecodeshw/springcloud_cfg/case-dev.properties",
"source": {
"profile": "dev1.0"
}
}]
}
http://localhost:8080/case-dev/cfg-v2.0
{
"name": "case-dev",
"profiles": ["cfg-v2.0"],
"label": "master",
"version": "d45f36e5235bbafcb288d553a53299e4f294a4ba",
"propertySources": [{
"name": "https://gitee.com/ecodeshw/springcloud_cfg/case-dev.properties",
"source": {
"profile": "dev1.0"
}
}]
}
http://localhost:8080/case/dev
{
"name": "case",
"profiles": ["dev"],
"label": "master",
"version": "d45f36e5235bbafcb288d553a53299e4f294a4ba",
"propertySources": [{
"name": "https://gitee.com/ecodeshw/springcloud_cfg/case-dev.properties",
"source": {
"profile": "dev1.0"
}
},
{
"name": "https://gitee.com/ecodeshw/springcloud_cfg/case.properties",
"source": {
"profile": "default 1.0"
}
}]
}
http://localhost:8080/master/case-dev
=>
{
"name": "master",
"profiles": ["case-dev"],
"label": "master",
"version": "d45f36e5235bbafcb288d553a53299e4f294a4ba",
"propertySources": []
}
运行config client 出现如下错误:
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'profile' in string value "${profile}"
最后发现spring cloud config uri 的地址错误。
最新文章
- css添加样式的四种方式
- shell 命令集
- osgi 2
- struts2 CVE-2012-0838 S2-007 Remote Code Execution &;&; Hotfix
- Quartus II9.0 使用中文输入的方法
- Intel 82599 万兆网卡
- Linux登录验证机制、SSH Bruteforce Login学习
- 【Todo】Java新技术学习笔记-from某技术分析
- 在C#中利用SharpZipLib进行文件的压缩和解压缩收藏
- Angular简单应用剖析
- POJ 1222 EXTENDED LIGHTS OUT(翻转+二维开关问题)
- js面向对象的学习笔记九(BOM 与 DOM 经常使用的属性分析)
- C#中的委托到底是什么概念??
- 创建Win32图形界面应用程序
- Spring Boot中使用 Spring Security 构建权限系统
- javascript中数组与字符串之间的转换以及字符串的替换
- 洛谷 P1055 ISBN号码【字符串+模拟】
- Spring-Cloud(三)Eureka注册中心实现高可用
- Java基础-异常、断言
- MySql修改数据表的基本操作(DDL操作)