Spring Boot: Use database and application.properties for configuration

后端 未结 7 1490
无人及你
无人及你 2020-12-29 15:52

I need to save the configuration of the Spring Boot application in the database.

Is it possible to store the database information in the application.properties

7条回答
  •  别那么骄傲
    2020-12-29 16:26

    What you need is Spring Cloud Config: https://cloud.spring.io/spring-cloud-config/

    It will use ad git repository (= database) with all the property files. At startup it will get the latest version, and uses this to launch the application.

    When you change the configuration at runtime, it is possible to refresh, without needing to restart!

提交回复
热议问题