规则:

一.获取文件属性
/{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 的地址错误。

最新文章

  1. css添加样式的四种方式
  2. shell 命令集
  3. osgi 2
  4. struts2 CVE-2012-0838 S2-007 Remote Code Execution && Hotfix
  5. Quartus II9.0 使用中文输入的方法
  6. Intel 82599 万兆网卡
  7. Linux登录验证机制、SSH Bruteforce Login学习
  8. 【Todo】Java新技术学习笔记-from某技术分析
  9. 在C#中利用SharpZipLib进行文件的压缩和解压缩收藏
  10. Angular简单应用剖析
  11. POJ 1222 EXTENDED LIGHTS OUT(翻转+二维开关问题)
  12. js面向对象的学习笔记九(BOM 与 DOM 经常使用的属性分析)
  13. C#中的委托到底是什么概念??
  14. 创建Win32图形界面应用程序
  15. Spring Boot中使用 Spring Security 构建权限系统
  16. javascript中数组与字符串之间的转换以及字符串的替换
  17. 洛谷 P1055 ISBN号码【字符串+模拟】
  18. Spring-Cloud(三)Eureka注册中心实现高可用
  19. Java基础-异常、断言
  20. MySql修改数据表的基本操作(DDL操作)

热门文章

  1. Linux常用基本命令:三剑客命令之-awk内置变量与自定义变量
  2. 【代码笔记】Web-ionic-头部与底部
  3. python之常用模块补充
  4. python之if循环
  5. vue-cli脚手架之webpack.prod.conf.js
  6. MQTT详解以及在IoT中的应用
  7. 解决ArrayList线程不安全
  8. 修改Devexpress DateEdit控件默认的日期格式和日历风格
  9. php处理手机号中间的四位为星号****
  10. 在Centos7下搭建Git服务器