简体   繁体   English

没有服务器的 Spring Cloud Config

[英]Spring Cloud Config without the server

The role of the Config Server while using Spring Cloud Config seems to be pretty dumb and hosting it seems to be an unnecessary overhead.使用 Spring Cloud Config 时 Config Server 的角色似乎非常愚蠢,托管它似乎是不必要的开销。 Is there a way to get the Clients to directly read configs from the git repo?有没有办法让客户端直接从 git repo 读取配置?

You can let Spring Boot look at specific locations for the config files: https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config-application-property-files您可以让 Spring Boot 查看配置文件的特定位置: https : //docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-外部配置应用程序属性文件

If you set this location to your cloned git repo (checked out on the branch you need) and solve the update from the origin repository, this might work.如果您将此位置设置为克隆的 git 存储库(在您需要的分支上签出)并解决来自原始存储库的更新,这可能会奏效。

它可以通过嵌入配置服务器的方法实现请参阅嵌入配置服务器部分

If you want to read the configuration for an application directly from the backend repository (instead of from the config server), you basically want an embedded config server with no endpoints. You can switch off the endpoints entirely by not using the @EnableConfigServer annotation (set spring.cloud.config.server.bootstrap=true).

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM