我正在尝试设置 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/