DATAES-870 - Workaround for reactor-netty error.

Original PR: #484
This commit is contained in:
Peter-Josef Meisch 2020-06-21 17:06:15 +02:00 committed by GitHub
parent d428db704e
commit 7cd871a419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -239,7 +239,11 @@ public class DefaultReactiveElasticsearchClient implements ReactiveElasticsearch
Duration connectTimeout = clientConfiguration.getConnectTimeout();
Duration soTimeout = clientConfiguration.getSocketTimeout();
HttpClient httpClient = HttpClient.create();
// DATAES-870: previously: HttpClient httpClient = HttpClient.create();
// disable pooling of connections (see https://github.com/spring-projects/spring-framework/issues/22464)
// otherwise we get errors: "Connection prematurely closed BEFORE response; nested exception is
// java.lang.RuntimeException: Connection prematurely closed BEFORE response"
HttpClient httpClient = HttpClient.newConnection().compress(true);
if (!connectTimeout.isNegative()) {
httpClient = httpClient.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, Math.toIntExact(connectTimeout.toMillis()));