(Spring cloud config server) Loading configuration other than pattern {application}/{profile}

徘徊边缘 提交于 2019-12-11 08:37:19

问题


In https://github.com/shauank/spring-cloud/tree/master/spring-cloud-prop, how to read property value from 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?


回答1:


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

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



来源:https://stackoverflow.com/questions/41358956/spring-cloud-config-server-loading-configuration-other-than-pattern-applicati

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!