Skip to content

Cassandra default configuration substitutions don't resolve against configuration derived from spring.data.cassandra properties #34643

Closed
@spadou

Description

@spadou

Using spring boot 2.7.9.

When defining properties for Cassandra configuration using Spring properties, the default values from the Driver default reference.conf does not resolve substitutions with the Spring properties.

For example, in the Cassandra driver reference.conf, with have the following properties with default value:
datastax-java-driver.advanced.metadata.schema.request-timeout=${datastax-java-driver.basic.request.timeout}
For this value I would expect that if we set the datastax-java-driver.basic.request.timeout using the corresponding Spring properties spring.data.cassandra.request.timeout, the value for datastax-java-driver.advanced.metadata.schema.request-timeout would be resolved to the same value. Currently this is not the case, when default are applied from reference.conf the substitutions are resolved against default values without taking the values set in the context.

I think the issue is that in CassandraAutoConfiguration the default are applied with config = config.withFallback(ConfigFactory.defaultReference()); which apply the default with substitutions already resolved. If config = config.withFallback(ConfigFactory.defaultReferenceUnresolved()); is used instead the default would keep the substitutions and resolve them against values set in the context which is what I would expect here.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions