This commit changes two things:

  1. Most primitives on CassandraProperties are replaced with object values.    This allows distinguishing between default-values and no-values. Then   CassandraAutoConfiguration.mapConfig() can use whenNonNull() predicate    to ignore those.

  2. CassandraProperties no longer populate default values that are overridable by spring.data.cassandra.config file. This let the defaults to be applied on top of the file   spring.data.cassandra.config; i.e. the config file have higher    precedence than the defaults, but lower that any spring.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:

  1. In case property spring.data.cassandra.contact-points is configured without a port - the value of spring.data.cassandra.port (which defaults to 9042) is used.

  2. Otherwise, in case contact-points on spring.data.cassandra.config file are defined -- then the contact-points must be configured with a port (as the conf file provides no separate port property).

  3. Otherwise, contact-points defaults to 127.0.0.1:9042 regardless of spring.data.cassandra.port configuration.


Closes gh-31025

Comment From: philwebb

Thanks very much for this contribution @ittays, it has now been merged into 2.6.x and forwards.