I have a Java Spring Boot application currently connected to an on premises database. I am trying to figure out how to toggle between the existing datasource and a new one I have added. I have both data sources added in the application yml and defined in 2 (Config classes). I want to add logic to determine which one to use, a simple if-statement.
-
1Toggle datasources how? During runtime?Prashant– Prashant2022-12-19 19:19:57 +00:00Commented Dec 19, 2022 at 19:19
-
I am using Feature toggles so essentially yes. Based on if the toggle is true I want to use a different datasource.My problem is I have configs for both data sources set up. Spring boot wont start the Tomcat server because it doesn't know which one to usetobes– tobes2022-12-19 19:38:50 +00:00Commented Dec 19, 2022 at 19:38
Add a comment
|