I have a situtation where I can either use blocking I/O library that access REST endpoint on outside service or I can directly call that REST with HttpClient like WebClient in this case. Now I wonder if there are any performance diffrences between wrapping call on that library and publishing it on Elastic thread or using WebClient to access endpoint.
How exactly are calls handled with both of this options. So let's say webflux uses single thread to process request. Request is then being handled with WebClient. Does that mean the thread or event will be blocked until request recieves all data and passes it back to the client? I'm also intrested where does EventLoop come in, does it come with WebClient or already at controller/service layer.
This is the alternitive I'm thinking about using since I already have library that's access that endpoint through OkHttpClient.
Mono blockingWrapper = Mono.fromCallable(() -> {
return /* make a remote synchronous call */
});
blockingWrapper = blockingWrapper.subscribeOn(Schedulers.boundedElastic());