-
I have multiple services, and potentially multiple instances of those services, all accessing the same PostgreSQL database. Instead of having each instance maintain their own connection pool, I'm looking at PgBouncer to handle connection pooling centrally. FWIW, when a central connection pool is used, clients normally use "direct" JDBC connections. In frameworks like Spring, this is usually done by replacing the HikariCP data source with a direct data source. For Quarkus however, it doesn't seem like Agroal can be bypassed. Of course I checked the docs, but was unable to find any hints towards how Agroal connection pooling can be disabled. So, can it be disabled? If not, any tips or best practics on how to use Quarkus with PgBouncer (or similar tech)? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Hi, have a look at this property - is that what you're looking for? Essentially it's a feature of Agroal - that's good because it means you're still benefiting from the integrations Quarkus/Agroal and all other frameworks, but disabling its internal pool. |
Beta Was this translation helpful? Give feedback.
-
Agroal has a 'pool-less' mode for this use case, that can be enabled by quarkus.datasource.jdbc.pooling-enabled. You would not want to use a default datasource and loose all the features provided by Agroal, like transaction integration, leak detection, metrics, etc. This mode also allows for a few optimizations in the pool. We also have a native pool (alternative to PgBouncer) called pgagroal that has some nice features as well. Check it out! |
Beta Was this translation helpful? Give feedback.
-
@Sanne @barreiro |
Beta Was this translation helpful? Give feedback.
Hi, have a look at this property - is that what you're looking for?
Essentially it's a feature of Agroal - that's good because it means you're still benefiting from the integrations Quarkus/Agroal and all other frameworks, but disabling its internal pool.