We connect to a server fts.server using a web client using the below method .
webClient.post(config.getInteger("fts.port"), config.getString("fts.server"), config.getString("fts.indexpath")).putHeader(HttpHeaders.Names.AUTHORIZATION, "Basic " + base64key).sendJsonObject(jreq, ar -> {
if (ar.succeeded()) {
}
else
{
}
}
In my case i have fts.server1 , fts.server2 , fts.server3 all providing the same service . I need to load balance the calls between the servers and if any of them are off line try the other server . Some thing like
webClient.post(config.getInteger("fts.port"), (config.getString("fts.server1")) or config.getString("fts.server2")) or config.getString("fts.server3")) , config.getString("fts.indexpath")).putHeader(HttpHeaders.Names.AUTHORIZATION, "Basic " + base64key).sendJsonObject(jreq, ar -> {
if (ar.succeeded()) {
}
else
{
}
}
How do i do it ?