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 的地址错误。
springcloud config的更多相关文章
- springcloud情操陶冶-springcloud config server(三)
承接前文springcloud情操陶冶-springcloud config server(二),本文就不讲述server了,就简单阐述下client的应用 前话 config server在引入的时 ...
- springcloud情操陶冶-springcloud config server(二)
承接前文springcloud情操陶冶-springcloud config server(一),本文将在前文的基础上讲解config server的涉外接口 前话 通过前文笔者得知,cloud co ...
- springcloud情操陶冶-springcloud config server(一)
承接前文springcloud情操陶冶-springcloud context(二),本文将在前文基础上浅析下ConfigServer的工作原理 前话 根据前文得知,bootstrapContext引 ...
- SpringCloud Config客户端
SpringCloud Config服务端 1.导入依赖 <dependency> <groupId>org.springframework.cloud</groupI ...
- springcloud-知识点总结(三):Hystrix & Dashboard & turbine & Zuul & SpringCloud Config
1.Hystrix断路器简介 Hystrix断路器简介 hystrix对应的中文名字是“豪猪”,豪猪周身长满了刺,能保护自己不受天敌的伤害,代表了一种防御机制,这与hystrix本身的功能不谋而合,因 ...
- SpringCloud-微服务配置统一管理SpringCloud Config(七)
前言:对于应用,配制文件通常是放在项目中管理的,它可能有spring.mybatis.log等等各种各样的配置文件和属性文件,另外你还可能有开发环境.测试环境.生产环境等,这样的话就得一式三份,若是传 ...
- SpringCloud 进阶之分布式配置中心(SpringCloud Config)
1. SpringCloud Config SpringCLoud Config 为微服务架构中的微服务提供集中化的外部配置支持,配置服务器为各个不同微服务应用 的所有环境提供了一个中心化的外部配置; ...
- 带你入门SpringCloud统一配置 | SpringCloud Config
前言 在微服务中众多服务的配置必然会出现相同的配置,如果配置发生变化需要修改,一个个去修改然后重启项目的方案是绝对不可取的.而 SpringCloud Config 就是一个可以帮助你实现统一配置选择 ...
- springcloud config配置读取优先级
情景描述 最近在修复Eureka的静态页面加载不出的缺陷时,最终发现是远程GIT仓库将静态资源访问方式配置给禁用了(spring.resources.add-mappings=false).虽然最后直 ...
- springcloud Config 入门,带视频
疯狂创客圈 Java 高并发[ 亿级流量聊天室实战]实战系列 [博客园总入口 ] 架构师成长+面试必备之 高并发基础书籍 [Netty Zookeeper Redis 高并发实战 ] 前言 Crazy ...
随机推荐
- IIS7下,显示PHP错误(不显示500错误,而显示详细错误)
玛德,IIS就是个坑,害得老子进行摸索了那么久,才找到了解决方法: 1.除了将php.ini配置为: display_errors = on; error_reporting = E_ALL & ...
- LintCode Binary Search
For a given sorted array (ascending order) and a target number, find the first index of this number ...
- sessionStorage记录返回前端的数据,用于解决登录拦截器刷新页面的问题
1.问题出现的场景与解决 实现一个登录拦截器,重写doFilter方法,判断用户的登录状态,在用户长时间未操作或者异地登录时前端进行提示,完整代码如下 public class LoginValida ...
- Layui tree 下拉菜单树
1.效果: 2.html 代码: <!DOCTYPE html> <html> <head> <meta charset="utf-8" ...
- SuperMap iServer 扩展/JAVA API 系列博客整理
转载:http://blog.csdn.net/supermapsupport/article/details/70158940 SuperMap iServer为广大用户提供了整套 SDK,应用开发 ...
- Linux 学习笔记之超详细基础linux命令 Part 13
Linux学习笔记之超详细基础linux命令 by:授客 QQ:1033553122 ---------------------------------接Part 12---------------- ...
- Android 裁剪人脸
人脸裁剪类 public final class FaceCj { private static BitmapFactory.Options BitmapFactoryOptionsbfo; priv ...
- list中放map的几种方式
package Test; import java.util.*; public class Test { public static void main(String[] args) { //第一种 ...
- android recovery 升级之USB设备挂载
Recovery升级过程,通常会从两个地方获取升级包update.zip升级,一般在线升级,会把升级包下载到cache分区,本地升级会从usb或者tf卡中升级.本文讨论下,本地USB升级时,无法挂载U ...
- 使用VSTS的Git进行版本控制(六)——拉取请求
使用VSTS的Git进行版本控制(六)--拉取请求 在将代码合并到主干之前,拉取请求让团队对特性分支的更改提供反馈.审阅人可以通过建议修改留下评论,并投票批准或拒绝代码. 任务1:在Visual St ...