You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
public Future<SqlConnection> connect(Context context) {
ConnectionFactory f = (ConnectionFactory)factories.get(this.idx);
return f.connect(context).onFailure(th -> {
idx = (idx + 1) % factories.size();
});
}
public void close(Promise<Void> promise) {
List<Future> list = new ArrayList(factories.size());
Iterator var3 = factories.iterator();
while(var3.hasNext()) {
ConnectionFactory factory = (ConnectionFactory)var3.next();
Promise<Void> p = Promise.promise();
factory.close(p);
list.add(p.future());
}
CompositeFuture.all(list).mapEmpty().onComplete(promise);
}
};
}
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:
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: