簡體   English   中英

沒有服務器的 Spring Cloud Config

[英]Spring Cloud Config without the server

使用 Spring Cloud Config 時 Config Server 的角色似乎非常愚蠢,托管它似乎是不必要的開銷。 有沒有辦法讓客戶端直接從 git repo 讀取配置?

您可以讓 Spring Boot 查看配置文件的特定位置: https : //docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-外部配置應用程序屬性文件

如果您將此位置設置為克隆的 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