このバージョンはまだ開発中であり、まだ安定しているとは見なされていません。最新の安定バージョンについては、Spring Cloud Config 5.0.5 を使用してください!

JDBC バックエンド

Spring Cloud Config Server supports JDBC (relational database) as a backend for configuration properties. You can enable this feature by adding spring-boot-starter-data-jdbc to the classpath and using the jdbc profile or by adding a bean of type JdbcEnvironmentRepository. If you include the right dependencies on the classpath (see the user guide for more details on that), Spring Boot configures a data source.

spring.cloud.config.server.jdbc.enabled プロパティを false に設定することにより、JdbcEnvironmentRepository の自動構成を無効にできます。

データベースには、APPLICATION、PROFILE、LABEL (通常の Environment の意味)と呼ばれる列を持つ PROPERTIES と呼ばれるテーブルに加えて、Properties スタイルのキーと値のペア用の KEY と VALUE が必要です。すべてのフィールドは Java では String 型であるため、必要な長さの VARCHAR にすることができます。プロパティ値は、{application}-{profile}.properties という名前の Spring Boot プロパティファイルから取得した場合と同じように動作します。これには、後処理ステップとして適用される(つまり、リポジトリの実装に直接適用されない)すべての暗号化と復号化が含まれます。

JDBC に使用されるデフォルトのラベルは master です。spring.cloud.config.server.jdbc.defaultLabel を設定することで変更できます。