x-pg-client.4.3.7.source-code.pool_config.adoc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vertx-pg-client Show documentation
Show all versions of vertx-pg-client Show documentation
The Reactive PostgreSQL Client
=== Server load balancing
You can configure the pool with a list of servers instead of a single server.
[source,$lang]
----
{@link examples.SqlClientExamples#poolConfig01}
----
The pool uses a round-robin load balancing when a connection is created to select different servers.
NOTE: this provides load balancing when the connection is created and not when the connection is borrowed from the pool.
=== Pool connection initialization
You can use the {@link io.vertx.sqlclient.Pool#connectHandler} to interact with a connection after it
has been created and before it is inserted in the pool.
[source,$lang]
----
{@link examples.SqlClientExamples#poolConfig02}
----
Once you are done with the connection, you should simply close it to signal the pool to use it.
© 2015 - 2024 Weber Informatics LLC | Privacy Policy