This commit changes two things:
-
Most primitives on
CassandraPropertiesare replaced with object values. This allows distinguishing between default-values and no-values. ThenCassandraAutoConfiguration.mapConfig()can usewhenNonNull()predicate to ignore those. -
CassandraPropertiesno longer populate default values that are overridable byspring.data.cassandra.configfile. This let the defaults to be applied on top of the filespring.data.cassandra.config; i.e. the config file have higher precedence than the defaults, but lower that anyspring.data.cassandra.*property.
On the test side, the file override-defaults.conf is defined to override the values that were non-overridable with values which are different from the default.
In this proposal, the spring.data.cassandra.port configuration has a bit rough behaviour:
-
In case property
spring.data.cassandra.contact-pointsis configured without a port - the value ofspring.data.cassandra.port(which defaults to 9042) is used. -
Otherwise, in case
contact-pointsonspring.data.cassandra.configfile are defined -- then the contact-points must be configured with a port (as the conf file provides no separate port property). -
Otherwise,
contact-pointsdefaults to127.0.0.1:9042regardless ofspring.data.cassandra.portconfiguration.
Closes gh-31025
Comment From: philwebb
Thanks very much for this contribution @ittays, it has now been merged into 2.6.x and forwards.