Although @EnableRdsInstance allows us to configure an RDS datasource, we can not use a placeholder for all of its value, specifically for the boolean value readReplicaSupport.
Would it be possible to have another value, let's say readReplicaSupportString (of type String as the name suggests), which would allow us to have a placeholder for this particular value ?
It makes sense for instance to have the read replica support in production but not in development while having this different configuration value in a properties file for dev and for prod.
The alternative is to create 2 configuration, one for dev and one for prod, but why having 2 configurations if we could/should have one.
Spring does that for the annotation @Scheduled for instance, there put a String alternative for non String values such as: fixedDelay (and fixedDelayString), or fixedRate (and fixedRateString).
You could answer that I should go with the configuration from properties instead of the Java configuration alternative, but the thing is that I need it (the Java config) in order to override the default values of the pool configuration through the provided RdsInstanceConfigurer interface.
Although
@EnableRdsInstance
allows us to configure an RDS datasource, we can not use a placeholder for all of its value, specifically for the boolean valuereadReplicaSupport
.Would it be possible to have another value, let's say
readReplicaSupportString
(of type String as the name suggests), which would allow us to have a placeholder for this particular value ?It makes sense for instance to have the read replica support in production but not in development while having this different configuration value in a properties file for dev and for prod. The alternative is to create 2 configuration, one for dev and one for prod, but why having 2 configurations if we could/should have one.
Spring does that for the annotation
@Scheduled
for instance, there put a String alternative for non String values such as:fixedDelay
(andfixedDelayString
), orfixedRate
(andfixedRateString
).You could answer that I should go with the configuration from properties instead of the Java configuration alternative, but the thing is that I need it (the Java config) in order to override the default values of the pool configuration through the provided
RdsInstanceConfigurer
interface.