You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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
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
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 propertiesspring.data.cassandra.request.timeout
, the value fordatastax-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 withconfig = config.withFallback(ConfigFactory.defaultReference());
which apply the default with substitutions already resolved. Ifconfig = 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.The text was updated successfully, but these errors were encountered: