(Spring Cloud 配置服务器)加载模式 {application}/{profile} 以外的配置 [英] (Spring cloud config server) Loading configuration other than pattern {application}/{profile}

查看:36
本文介绍了(Spring Cloud 配置服务器)加载模式 {application}/{profile} 以外的配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://github.com/shauank/spring-cloud/tree/master/spring-cloud-prop,如何从 email-conf.properties 读取属性值.

In https://github.com/shauank/spring-cloud/tree/master/spring-cloud-prop, how to read property value from email-conf.properties.

假设:spring.application.name=reservation 和 profile=default.按照惯例,spring cloud 将加载 reservation.propertiesapplication.properties.但我也想加载 email-conf.properties.如何实现?

Assuming: spring.application.name=reservation and profile=default. As per convention spring cloud will load reservation.properties and application.properties. But I wanted to load email-conf.properties also. How to achieve?

推荐答案

参见 云配置文档,访问端点/{name}/{profile}/{label}/{path}获取纯文本文件.

See the doc of cloud config, access the endpoint /{name}/{profile}/{label}/{path} for plain text file.

在您的情况下,您可以通过 url /reservation/default/master/email-conf.properties 获取 email-conf.properties 的内容.

In your case, you can get the content of email-conf.properties via url /reservation/default/master/email-conf.properties.

这篇关于(Spring Cloud 配置服务器)加载模式 {application}/{profile} 以外的配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆