HttpHandler httpHandler = HttpClient.of(baseUri)
.configure(
RequestTimeout.ofSeconds(10),
ConnectionPoolSettings
.connectionPoolSettings()
.maxConnections(100)
.idleTimeout(Duration.ofMinutes(1))
);
import org.http4k.core.CacheControl;
CacheControl cacheControl = CacheControl.CacheControlBuilder.aCacheControl()
.withMaxAge(Duration.ofMinutes(10))
.withMustRevalidate(true)
.build();
AsyncHttpClient asyncHttpClient = HttpClients.createAsync();
CompletableFuture<Response> future = asyncHttpClient
.sendAsync(request, Duration.ofSeconds(10))
.thenApply(Response::new);
future.thenAccept(response -> {
});