We are using Vert.x WebClient (io.vertx.ext.web.client.WebClient). We have vert.x processes running on k8s env.
The requester service which use the client always reach the same pod while we have multiple pods behind the k8s-service.
I am initiating the client this way:
private void initAsyncClient() {
WebClientOptions options = new WebClientOptions();
options.setConnectTimeout(timeout);
options.setMaxPoolSize(poolSize);
webClient = WebClient.create(vertx, options);
}
We invoke the endpoint this way:
webClient.getAbs(absoluteUrl)
.send(response -> {
if (response.succeeded() && HttpStatus.valueOf(response.result().statusCode()).is2xxSuccessful()) {
try {
log.info(data);
} catch (Exception e) {
//
}
});
We are not sure what we are doing wrong as when we use curl and hitting the same endpoint (k8s-service) we can see the request being forward to both pods instances.
using vert.x version 3.9.1