aws/aws-secretsmanager-jdbc

Quarkus fails

psaraf opened this issue · 1 comments

I am getting exception when I try to connect serverless using quarkus
here are parameter i am passing

quarkus.datasource.jdbc.driver=software.aws.rds.jdbc.postgresql.Driver
quarkus.datasource.username = ${secretname}
quarkus.datasource.jdbc.url = jdbc-secretsmanager:postgresql://dbpostgres-serverless.cluster-xxxx.us-east-1.rds.amazonaws.com:5432/dbname
quarkus.hibernate-orm.database.default-schema=dev_base

logs and exception

319 [JPA Startup Thread: ] higRequestId= WARN JdbcEnvironmentInitiator - HHH000342: Could not obtain connection to query metadata: java.sql.SQLException: Driver does not support the provided URL: jdbc-secretsmanager:postgresql:/db-postgres-serverless.cluster-xxxxx.us-east-1.rds.amazonaws.com:5432/dbname

Caused by: java.sql.SQLException: Driver does not support the provided URL: jdbc-secretsmanager:postgresql://serverlessrdsnamexxx.us-east-1.rds.amazonaws.com:5432/dbname

@psaraf you must use the driver class mentioned in the readme: com.amazonaws.secretsmanager.sql.AWSSecretsManagerPostgreSQLDriver.

aws-secretsmanager-jdbc uses AWS SDK v1 under the hood, software.aws.rds.jdbc.postgresql.Driver comes from the SDK v2 (which I believe is used in Quarkus).

The good thing is that you can use SDK v1 and SDK v2 side by side without class conflicts.