Configuring Quarkus with Agroal for AWS RDS Proxy

59 Views Asked by At

We've just started using AWS RDS Proxy for our lambdas. I'm trying to figure out the optimal Agroal configuration in Quarkus 3 for using this, to replace the Agroal pooled config that I had before.

I'm assuming that the below will work - in other words, that I need to specify POOLLESS and although I have to specify a maxSize, it doesn't matter what it is, because Agroal will just delegate all requests for connections to RDS Proxy?

@ApplicationScoped
public class Config {
    @Produces
    public AgroalDataSource dataSource() throws SQLException {
        AgroalDataSourceConfigurationSupplier dataSourceConfiguration = new AgroalDataSourceConfigurationSupplier();

        dataSourceConfiguration
                .dataSourceImplementation(
                        AgroalDataSourceConfiguration.DataSourceImplementation.AGROAL_POOLLESS)
                .connectionPoolConfiguration()
                .maxSize(?) // Looks like I still have to have this?
                .connectionFactoryConfiguration()
                .jdbcUrl("redacted")
                .credential(new NamePrincipal("redacted"))
                .credential(new SimplePassword("redacted"));

        return AgroalDataSource.from(dataSourceConfiguration.get());
    }
}
0

There are 0 best solutions below