Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spadou opened this issue Mar 20, 2023 · 0 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@spadou
Copy link

spadou commented Mar 20, 2023

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.

@spadou spadou changed the title Cassandra default configuration substitutions doesn't resolve against Cassandra default configuration substitutions doesn't resolve against Spring properties Mar 20, 2023
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 20, 2023
@wilkinsona wilkinsona changed the title Cassandra default configuration substitutions doesn't resolve against Spring properties Cassandra default configuration substitutions doesn't resolve against configuration derived from spring.data.cassandra properties Mar 28, 2023
@wilkinsona wilkinsona changed the title Cassandra default configuration substitutions doesn't resolve against configuration derived from spring.data.cassandra properties Cassandra default configuration substitutions don't resolve against configuration derived from spring.data.cassandra properties Mar 28, 2023
@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 28, 2023
@wilkinsona wilkinsona added this to the 2.7.x milestone Mar 28, 2023
@wilkinsona wilkinsona self-assigned this Mar 28, 2023
@wilkinsona wilkinsona modified the milestones: 2.7.x, 2.7.11 Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants