Adds property to disable JdbcEnvironmentRepository

- Add "enabled" property to JdbcEnvironmentProperties
- Make JdbcEnvironmentRepository configuration depending
  on new property
- Add integration test to verify the new property

Fixes gh-1605
Fixes gh-1623
This commit is contained in:
Thomas Vitale
2020-05-16 00:36:24 +02:00
committed by spencergibb
parent 4bbb4ca5e4
commit 841038f684
4 changed files with 105 additions and 0 deletions

View File

@@ -804,6 +804,8 @@ You can enable this feature by adding `spring-jdbc` to the classpath and using t
If you include the right dependencies on the classpath (see the user guide for more details on that), Spring Boot configures a data source.
// TODO Which user guide? When we know that, we should add a link to it.
You can disable autoconfiguration for `JdbcEnvironmentRepository` by setting the `spring.cloud.config.server.jdbc.enabled` property to `false`.
The database needs to have a table called `PROPERTIES` with columns called `APPLICATION`, `PROFILE`, and `LABEL` (with the usual `Environment` meaning), plus `KEY` and `VALUE` for the key and value pairs in `Properties` style.
All fields are of type String in Java, so you can make them `VARCHAR` of whatever length you need.
Property values behave in the same way as they would if they came from Spring Boot properties files named `{application}-{profile}.properties`, including all the encryption and decryption, which will be applied as post-processing steps (that is, not in the repository implementation directly).