server failover with Quarkus Reactive MySQL Clients / io.vertx.mysqlclient

319 Views Asked by At

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.

1

There are 1 best solutions below

0
On BEST ANSWER

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));