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

Use of quarkus-agroal with GCP CloudSql #5824

Closed
jtama opened this issue Nov 28, 2019 · 4 comments
Closed

Use of quarkus-agroal with GCP CloudSql #5824

jtama opened this issue Nov 28, 2019 · 4 comments
Labels
area/documentation kind/enhancement New feature or request triage/wontfix This will not be worked on

Comments

@jtama
Copy link
Contributor

jtama commented Nov 28, 2019

Description
As of now using quarkus-agroal to connect with GCP is possible but nor documented or trivial.

Implementation ideas
First option is to add com.google.cloud.sql:postgres-socket-factory or com.google.cloud.sql:mysql-socket-factory to the application dependencies and configuring datasource as follow :

jdbc:postgresql:///<DB_NAME>?socketFactory=com.google.cloud.sql.postgres.SocketFactory&cloudSqlInstance=<CLOUD_SQL_INSTANCE>

Second option would be to add a dedicated options such as use-cloud-sql and cloud-sql-instance to delegate the url forging to the io.quarkus.agroal.runtime.AbstractDataSourceProducer class.
I don't know if we could arrange some kind of optional maven dependency to the google socket factory jar, to prevent loading unneeded jar.

I tried using both options. You can check the code for agroal extension here (https://github.com/jtama-op/quarkus/commit/eb27113c050b2c98a0ef046a84d366484adf6e21) (though it won't package due to Dependency convergence error for com.google.http-client:google-http-client-jackson2:1.30.1)

Anyway documenting this would be great as quarkus is great tool for deploying apps on Cloud and GCP beeing one of the top 3 provider.

@jtama jtama added the kind/enhancement New feature or request label Nov 28, 2019
@gsmet
Copy link
Member

gsmet commented Nov 28, 2019

@jtama-op would you be up for it?

It would be nice to have a guide similar to https://quarkus.io/guides/deploying-to-azure-cloud with all the possible GCP-related issues.

The sources are there: https://github.com/quarkusio/quarkus/tree/master/docs/src/main/asciidoc .

It doesn't need to be a big one, we can start to collect the solutions for the issues you solved.

@jtama
Copy link
Contributor Author

jtama commented Nov 28, 2019

Ok. Should I create a dedicated branch With documentation only ? Or do I add it to my master where there is also my code to modify the extension?

@gsmet
Copy link
Member

gsmet commented Nov 28, 2019

Maybe create a PR with all you have and we can discuss from there what is better?

@jtama
Copy link
Contributor Author

jtama commented Dec 2, 2019

Please check #5901 as a base for discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation kind/enhancement New feature or request triage/wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants