Skip to content

Commit bff5478

Browse files
committed
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
1 parent edb70b4 commit bff5478

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ public class ReactorClientHttpConnector implements ClientHttpConnector {
4848

4949

5050
/**
51-
* Create a Reactor Netty {@link ClientHttpConnector} with default {@link ClientOptions}
52-
* and SSL support enabled.
51+
* Create a Reactor Netty {@link ClientHttpConnector}
52+
* with default {@link ClientOptions} and HTTP compression support enabled.
5353
*/
5454
public ReactorClientHttpConnector() {
55-
this.httpClient = HttpClient.create();
55+
this.httpClient = HttpClient.builder()
56+
.options(options -> options.compression(true))
57+
.build();
5658
}
5759

5860
/**

0 commit comments

Comments
 (0)