Spring 云配置服务 - Git 与 Native

标签 spring git microservices spring-cloud-config

我正在尝试设置 Spring Cloud 配置服务器。我看到有两种存储属性的选项。 Git 或 Native 文件系统。看起来人们更倾向于使用 GIT 而不是 Native。

我们的项目遵循基于主干的开发,这意味着它不会在每次发布到生产时切断分支。

如果我们使用GIT读取属性,并且如果有人在部署后更改属性,那么很可能会读取更改的属性,这可能会在生产中产生问题。

有人遇到过这个问题吗?你是如何解决这些问题的?

最佳答案

如果您的Spring Cloud Git Backend设置为标签或提交ID(而不是分支),不应读取任何修改。

This repository implementation maps the {label} parameter of the HTTP resource to a git label (commit id, branch name or tag).
If the git branch or tag name contains a slash ("/"), then the label in the HTTP URL should be specified with the special string "(_)" instead (to avoid ambiguity with other URL paths).

由于提交 ID 或标记是不可变的,因此应该避免读取新内容。

关于Spring 云配置服务 - Git 与 Native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53768891/

相关文章:

Spring 启动 : Enable HTTPS for embedded tomcat

java - 为什么我的 Spring @Autowired 字段为空?

git - Maven Release Plugin 在 Jenkins Pipeline 中的使用

Git 日志 rebase

architecture - 微服务关系/依赖策略

java - 通过预授权保护 vaadin 8 View (Spring Security)

java - 如何使用唯一的id(不在文件内)定义Spring bean?

git - 即使在 "obvious"情况下也强制 git 手动 merge

docker - Docker没有看到main.go

java - Spring Boot微服务在docker-swarm中消耗大量内存