简体   繁体   English

Spring Cloud:带有 JDBC 后端的 Git

[英]Spring Cloud: Git with JDBC backend

Problem: I only have either JDBC OR Git working.问题:我只有 JDBCGit 工作。 Just one thing.就一件事。 If I change the property spring.cloud.config.server.bootstrap to true or false .如果我将属性spring.cloud.config.server.bootstrap更改为truefalse

Question: How do I configure my application to work with JDBC AND Git?问题:如何配置我的应用程序以使用 JDBCGit?

I am attaching the contents of the bootstrap.properties .我附上了bootstrap.properties的内容。

spring:
  profiles:
    active: jdbc, git
  application:
    name: configuration-server
  cloud:
    config:
      uri: http://localhost:8888
      name: configuration-server
      server:
        jdbc:
          order: 1
        git:
          uri: <hidden>
          order: 2
    bus:
      enabled: true

Solution: It turned out quite by accident to find out that with such a bundle, you need to use the parameters for JDBC: APPLICATION, PROFILE and LABEL, the same by which you can find the configuration in the GIT repository.解决方案:结果很偶然地发现,使用这样的包,您需要使用 JDBC 的参数:APPLICATION、PROFILE 和 LABEL,通过这些参数您可以在 GIT 存储库中找到配置。 At the same time, in the opposite direction - it works differently.同时,在相反的方向 - 它的工作方式不同。 That is, to get the configuration from the GIT repository, you do not need to create the necessary entries in the database.也就是说,要从 GIT 存储库获取配置,您不需要在数据库中创建必要的条目。 And that's all, despite the fact that the priority for JDBC is higher than that of GIT.这就是全部,尽管 JDBC 的优先级高于 GIT。

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

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