The following function:
public ScoringResponse search(SearchRequest searchRequest) {
return webClient.post()
.bodyValue(searchRequest)
.retrieve()
.onStatus(HttpStatusCode::isError, ERROR_HANDLER::handleError)
.bodyToMono(ScoringResponse.class)
.timeout(Duration.ofMillis(5_000))
.subscribeOn(Schedulers.boundedElastic())
.block();
}
It return this error:
java.lang.IllegalStateException: block()/blockFirst()/blockLast() are
blocking, which is not supported in thread reactor-http-epoll-2
try this,