Autoconfigure R2DBC support for Cloud SQL
See original GitHub issueWhen using the Spring Cloud GCP Cloud SQL PostgreSQL starter (spring-cloud-gcp-starter-sql-postgresql
) you get a JDBC-based stack using org.springframework.boot:spring-boot-starter-jdbc
and the org.postgresql:postgresql
JDBC driver.
For Spring WebFlux applications I would like to be able to use Cloud SQL via R2DBC instead of JDBC.
I can use R2DBC with Spring Boot and a plain PostgreSQL database via org.springframework.boot:spring-boot-starter-data-r2dbc
and the io.r2dbc:r2dbc-postgresql
R2DBC driver for PostgreSQL.
I have found https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/blob/master/r2dbc-postgres and an example project at https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/cloud-sql/r2dbc that shows what dependencies to add and how to create a ConnectionFactory
bean, but it would be great if Spring Cloud GCP would have a starter and auto-configuration for this, so Spring Cloud GCP users don’t need to manage and configure these dependencies.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:6 (3 by maintainers)
Top GitHub Comments
Yes, did not work. Now I retried with this little :gcp: in the URL I had overlooked and it works. (⌒_⌒;) Thanks.
It does in that we can make the correct
ConnectionFactory
creation automatic given a dependency on R2DBC and socket factory. I’ll update the issue title to reflect that.