Add support for external configuration for Cassandra

Closes gh-24065
This commit is contained in:
Stephane Nicoll
2020-12-22 18:10:18 +01:00
parent 7eccf4a92d
commit 9b0cdac97a
8 changed files with 145 additions and 28 deletions

View File

@@ -4554,7 +4554,9 @@ If you need to configure the port, use `spring.data.cassandra.port`.
====
The Cassandra driver has its own configuration infrastructure that loads an `application.conf` at the root of the classpath.
Spring Boot does not look for such a file and rather provides a number of configuration properties via the `spring.data.cassandra.*` namespace.
Spring Boot does not look for such a file by default but can load one using `spring.data.cassandra.config`.
If a property is both present in `+spring.data.cassandra.*+` and the configuration file, the value in `+spring.data.cassandra.*+` takes precedence.
For more advanced driver customizations, you can register an arbitrary number of beans that implement `DriverConfigLoaderBuilderCustomizer`.
The `CqlSession` can be customized with a bean of type `CqlSessionBuilderCustomizer`.
====