Reputation: 1987
Does io.vertx.mysqlclient
support server failover as it can be set up with MySQL Connector/J?
My application is based on quarkus using io.vertx.mutiny.mysqlclient.MySQLPool
which in turn is based on io.vertx.mysqlclient
. If there is support for server failover in that stack, how can it be set up? I did not find any hints in the documentation and code.
Upvotes: 4
Views: 367
Reputation: 9128
No it doesn't support failover.
You could create two clients and then use Munity failover methods to get the same effect:
MySQLPool client1 = ...
MySQLPool client2 = ...
private Uni<List<Data>> query(MySQLPool client) {
// Use client param to send queries to the database
}
Uni<List<Data>> results = query(client1)
.onFailure().recoverWithUni(() -> query(client2));
Upvotes: 5