Revert "Allow ExchangeStrategies customizations in WebClient"

This reverts commit 43e047c523.
This commit is contained in:
Brian Clozel
2019-12-02 10:29:24 +01:00
parent 4f86282b14
commit 25554d0b21
17 changed files with 32 additions and 322 deletions

View File

@@ -42,14 +42,14 @@ The following example configures <<web-reactive.adoc#webflux-codecs, HTTP codecs
[source,java,intent=0]
[subs="verbatim,quotes"]
----
Consumer<ExchangeStrategies.Builder> customizeCodecs = builder -> {
builder.codecs(configurer -> {
//...
});
};
ExchangeStrategies strategies = ExchangeStrategies.builder()
.codecs(configurer -> {
// ...
})
.build();
WebClient client = WebClient.builder()
.exchangeStrategies(customizeCodecs)
.exchangeStrategies(strategies)
.build();
----
====
@@ -73,35 +73,7 @@ modified copy without affecting the original instance, as the following example
----
====
[[webflux-client-builder-maxinmemorysize]]
=== MaxInMemorySize
Spring WebFlux configures by default a maximum size for buffering data in-memory when decoding
HTTP responses with the `WebClient`. This avoids application memory issues if the received
response is much larger than expected.
You can configure a default value that might not be enough for your use case, and your application
can hit that limit with the following:
----
org.springframework.core.io.buffer.DataBufferLimitException: Exceeded limit on max bytes to buffer
----
You can configure this limit on all default codecs with the following code sample:
====
[source,java,intent=0]
[subs="verbatim,quotes"]
----
WebClient webClient = WebClient.builder()
.exchangeStrategies(configurer ->
configurer.codecs(codecs ->
codecs.defaultCodecs().maxInMemorySize(2 * 1024 * 1024)
)
)
.build();
----
====
[[webflux-client-builder-reactor]]
=== Reactor Netty