public Optional<BasicDto> findByBasicId(int basicId, int min
, int max, String otherInfo) {
Consumer<ClientCodecConfigurer> consumer = configurer ->
configurer.defaultCodecs().enableLoggingRequestDetails(true);
WebClient client = WebClient.builder()
.clientConnector(new ReactorClientHttpConnector(
HttpClient.create().followRedirect(true)
))
.exchangeStrategies(ExchangeStrategies.builder()
.codecs(consumer).build())
.build();
Mono<BasicDto> result = client.get()
.uri(builder -> builder.scheme(REST_SCHEME)
.host(REST_SERVER).port(REST_PORT)
.path(REST_PATH + basicId)
.queryParam("min", min)
.queryParam("max", max)
.queryParam("otherInfo", otherInfo)
.build())
.accept(MediaType.APPLICATION_JSON)
.retrieve()
.bodyToMono(BasicDto.class);
return Optional.of(result.block(Duration.ofMinutes(1)));
}