Browse Source

Enable HTTP compression Reactor ClientHttpConnector

`ReactorClientHttpConnector` provides an adapter layer to `WebClient`
for using Reactor-Netty's `HttpClient`.
This commit enables HTTP compression support by default for this client
Connector.

Another constructor is still available for providing a custom
`HttpOptions` configuration.

Issue: SPR-15908
pull/1513/merge
Brian Clozel 7 years ago
parent
commit
bff54788e8
  1. 8
      spring-web/src/main/java/org/springframework/http/client/reactive/ReactorClientHttpConnector.java

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

@ -48,11 +48,13 @@ public class ReactorClientHttpConnector implements ClientHttpConnector { @@ -48,11 +48,13 @@ public class ReactorClientHttpConnector implements ClientHttpConnector {
/**
* Create a Reactor Netty {@link ClientHttpConnector} with default {@link ClientOptions}
* and SSL support enabled.
* Create a Reactor Netty {@link ClientHttpConnector}
* with default {@link ClientOptions} and HTTP compression support enabled.
*/
public ReactorClientHttpConnector() {
this.httpClient = HttpClient.create();
this.httpClient = HttpClient.builder()
.options(options -> options.compression(true))
.build();
}
/**

Loading…
Cancel
Save