Spring boot reset datasource on the fly

前端 未结 3 1985
悲哀的现实
悲哀的现实 2021-02-15 13:36

I am trying to update datasource in Spring Boot when the DB property like DB name, password or hostname changes in the spring configuration file or custom DB property file. When

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-15 13:58

    You can use Spring's Dynamic Data Source routing and check if it helps? It's a very old technique and might come handy, if that serves your purpose.

    But please note that - this is data source routing and not new data source configuration.

    https://spring.io/blog/2007/01/23/dynamic-datasource-routing/

提交回复
热议问题