Version
5.0.5
Context
When I use vertx threading model as eventloop or worker while using vertx httpclient, the callbacks are properly coming back on eventloop or worker respectively. However, when I use threading model as virtual thread, the callback are on event loop.
Steps to reproduce
Deploy a verticle with threading model as virtual thread and create a httpclient in the start/constructor method. Enable the log statements in code below to check the threads on which callback is happening.
Sample code:
//log.info("Thread name: {}", Thread.currentThread().getName());
httpClient
.request(requestToBeSent.requestOptions())
.compose(httpClientRequest -> {
//log.info("Compose thread name: {}", Thread.currentThread().getName());
if (requestToBeSent.body() == null) {
return httpClientRequest.send();
} else {
return httpClientRequest.send(requestToBeSent.body());
}
})
.onComplete(httpResponse -> {
//log.info("Complete thread name: {}", Thread.currentThread().getName());
if (httpResponse.failed() && httpResponse.cause() != null) {
log.error("Issue while getting the response after sending the request.", httpResponse.cause());
}
});
Do you have a reproducer?
No response