规则:

一.获取文件属性
/{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的更多相关文章

  1. springcloud情操陶冶-springcloud config server(三)

    承接前文springcloud情操陶冶-springcloud config server(二),本文就不讲述server了,就简单阐述下client的应用 前话 config server在引入的时 ...

  2. springcloud情操陶冶-springcloud config server(二)

    承接前文springcloud情操陶冶-springcloud config server(一),本文将在前文的基础上讲解config server的涉外接口 前话 通过前文笔者得知,cloud co ...

  3. springcloud情操陶冶-springcloud config server(一)

    承接前文springcloud情操陶冶-springcloud context(二),本文将在前文基础上浅析下ConfigServer的工作原理 前话 根据前文得知,bootstrapContext引 ...

  4. SpringCloud Config客户端

     SpringCloud Config服务端 1.导入依赖 <dependency> <groupId>org.springframework.cloud</groupI ...

  5. springcloud-知识点总结(三):Hystrix & Dashboard & turbine & Zuul & SpringCloud Config

    1.Hystrix断路器简介 Hystrix断路器简介 hystrix对应的中文名字是“豪猪”,豪猪周身长满了刺,能保护自己不受天敌的伤害,代表了一种防御机制,这与hystrix本身的功能不谋而合,因 ...

  6. SpringCloud-微服务配置统一管理SpringCloud Config(七)

    前言:对于应用,配制文件通常是放在项目中管理的,它可能有spring.mybatis.log等等各种各样的配置文件和属性文件,另外你还可能有开发环境.测试环境.生产环境等,这样的话就得一式三份,若是传 ...

  7. SpringCloud 进阶之分布式配置中心(SpringCloud Config)

    1. SpringCloud Config SpringCLoud Config 为微服务架构中的微服务提供集中化的外部配置支持,配置服务器为各个不同微服务应用 的所有环境提供了一个中心化的外部配置; ...

  8. 带你入门SpringCloud统一配置 | SpringCloud Config

    前言 在微服务中众多服务的配置必然会出现相同的配置,如果配置发生变化需要修改,一个个去修改然后重启项目的方案是绝对不可取的.而 SpringCloud Config 就是一个可以帮助你实现统一配置选择 ...

  9. springcloud config配置读取优先级

    情景描述 最近在修复Eureka的静态页面加载不出的缺陷时,最终发现是远程GIT仓库将静态资源访问方式配置给禁用了(spring.resources.add-mappings=false).虽然最后直 ...

  10. springcloud Config 入门,带视频

    疯狂创客圈 Java 高并发[ 亿级流量聊天室实战]实战系列 [博客园总入口 ] 架构师成长+面试必备之 高并发基础书籍 [Netty Zookeeper Redis 高并发实战 ] 前言 Crazy ...

随机推荐

  1. jQuery的DOM操作之设置和获取HTML、文本和值 html()text()val()

    1. html()方法: 此方法类似于JavaScript中的innerHTML属性,可以用来读取或者设置某个元素中的html内容. <html> <head> <met ...

  2. HDU5037(SummerTrainingDay01-C)

    Frog Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Subm ...

  3. JQuery的事件委托;jQuery注册事件;jQuery事件解绑

    一.事件 ①事件委托:就是给子元素的父元素或者祖先元素注册一个事件,但是事件的执行者是子元素,委托事件的好处是能够给动态创建出来时元素也加上事件. ②简单事件:就是给自己注册事件自己执行动态创建出来的 ...

  4. linux学习笔记-目录相关知识

    我的邮箱地址:zytrenren@163.com欢迎大家交流学习纠错! linux的目录结构及作用是根据fhs标准定制的,以下列出一些常用的目录的作用,以及fhs官方网站的连接 FHS官方网站的连接: ...

  5. c++中的this指针和c#中的this引用

    先总结一下: 在c++中this为指针,使用"->"操作符来获取当前实例中的成员 在c#中this为引用,使用"."操作符来获取当前实例中的成员 下面内容 ...

  6. android recovery 升级UI显示之资源文件

    Recovery只有在升级的时候才会呈现给用户,所以界面一般都很简单,没有android上层那么绚丽,所以recovery下面对图片的支持很有限,仅支持png图片显示,所以我们可以看到,recover ...

  7. Scala多重继承及AOP

    package traitandclass /** * Created by zhen on 2018/8/23. */ class Human { println("Human" ...

  8. [20170824]11G备库启用DRCP连接.txt

    [20170824]11G备库启用DRCP连接.txt --//参考链接:http://blog.itpub.net/267265/viewspace-2099397/blogs.oracle.com ...

  9. MIME 内容类型

    MIME内容类型 https://www.iana.org/assignments/media-types/media-types.xhtml 媒体在各浏览器的支持情况: https://develo ...

  10. C#语言————选择结构

    int[] num = new int[] {23,76,54,87,51,12 }; //冒泡排序 for (int i = 0; i < num.Length - 1; i++) { for ...