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
Breaking change #1324
Comments
@hogmuzzle the API changed after #1305 There is an example of the new API here: https://vertx.io/docs/vertx-pg-client/java/#_dynamic_connection_configuration You no longer need access to the @vietj can you please update the https://github.com/vert-x3/wiki/wiki/4.4.2-Deprecations-and-breaking-changes ? |
that's an internal change, not sure we need to document that |
@hogmuzzle can you elaborate about exactly what you want to achieve ? it is not clear to me (also the fact you had to use internal stuff from vertx) |
Right. I thought we had removed the
I believe they want to create new connections depending on which server in the cluster is currently the leader (in a HA scenario). |
In version 4.2.4 io.vertx.sqlclient.impl.PoolBase had accessible field closeFuture and it was possible to correctly create custom connectionProvider and add ConnectionFactory to close future.
List lst = pgConnectOptions.stream()
.map(options -> driver.createConnectionFactory(vertx.getDelegate(), options))
.collect(Collectors.toList());
ConnectionFactory factory = serverSelector(lst);
pool.getDelegate().connectionProvider(factory::connect);
PgPoolImpl poolBase = (PgPoolImpl) pool.getDelegate();
CloseFuture closeFuture = poolBase.closeFuture();
closeFuture.add(factory);
It is no longer possible.
Could you please add information to your documentation as to how to create a connection provider. This information used to be in your documentation but it not there any more or complement ConnectionFactory with one more implementation of ConnectionFactory.
static ConnectionFactory failOverSelector(final List factories) {
return factories.size() == 1 ? (ConnectionFactory)factories.get(0) : new ConnectionFactory() {
int idx = 0;
We use PostgreSQL HA with Patroni and roundRobinSelector is of no use. I have never seen a configuration where roundRobinSelector was used.
The text was updated successfully, but these errors were encountered: