spring-attic / spring-cloud-aws

All development has moved to https://github.com/awspring/spring-cloud-aws Integration for Amazon Web Services APIs with Spring
https://awspring.io/
Apache License 2.0
589 stars 376 forks source link

[RDS] @EnableRdsInstance enhancement #732

Closed Kraignos closed 3 years ago

Kraignos commented 3 years ago

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.

eddumelendez commented 3 years ago

@EnableRdsInstance has been deprecated as part of 2.3. Instead there are configuration property for this scenario cloud.aws.rds.*.readReplicaSupport