Browse Source

Remove temporary workaround for reactor-netty client

Now that https://github.com/reactor/reactor-netty/issues/138 is solved,
this commit removes the temporary workaround introduced in SPR-15784
but leaves the general mechanism for detecting empty responses.
pull/1520/head
Brian Clozel 7 years ago
parent
commit
1a883b863d
  1. 9
      spring-web/src/main/java/org/springframework/http/client/reactive/ReactorClientHttpConnector.java

9
spring-web/src/main/java/org/springframework/http/client/reactive/ReactorClientHttpConnector.java

@ -38,12 +38,6 @@ import org.springframework.http.HttpMethod; @@ -38,12 +38,6 @@ import org.springframework.http.HttpMethod;
*/
public class ReactorClientHttpConnector implements ClientHttpConnector {
private static final Mono<ClientHttpResponse> NO_CLIENT_RESPONSE_ERROR = Mono.error(
new IllegalStateException("HttpClient completed without a response. " +
"As a temporary workaround try to disable connection pool. " +
"See https://github.com/reactor/reactor-netty/issues/138."));
private final HttpClient httpClient;
@ -78,8 +72,7 @@ public class ReactorClientHttpConnector implements ClientHttpConnector { @@ -78,8 +72,7 @@ public class ReactorClientHttpConnector implements ClientHttpConnector {
.request(adaptHttpMethod(method),
uri.toString(),
request -> requestCallback.apply(adaptRequest(method, uri, request)))
.map(this::adaptResponse)
.switchIfEmpty(NO_CLIENT_RESPONSE_ERROR);
.map(this::adaptResponse);
}
private io.netty.handler.codec.http.HttpMethod adaptHttpMethod(HttpMethod method) {

Loading…
Cancel
Save